miscellaneous python stuff