def get_home_dir():
 home = os.getenv('HOME')
 if (home is None):
  home = os.path.expanduser('~')
  if (home == '~'):
   home = os.getenv('USERPROFILE')
 assert (home is not None)
 return home

def get_home_dir ( ) : home = os . getenv ( 'HOME' ) if ( home is None ) : home = os . path . expanduser ( '~' ) if ( home == '~' ) : home = os . getenv ( 'USERPROFILE' ) assert ( home is not None ) return home
return user home directory .