Useful random python code.  Sticking it here so I can find it.