Some handy helpers in Python