Some useful Python functions and classes.