Random (marginally) useful Python functions