general python utilities and stuff