Collection of useful python functions