misc utilities written in python