Utility codes for python