Python utility functions I've grown sick of writing from memory