Various python utility functions I use.