Some useful python utility functions for myself.