A collection of useful python functions