Eclectic assortment of python code