some python utilities