def load_obj(load_path):
 if isinstance(load_path, str):
  load_path = os.path.expandvars(os.path.expanduser(load_path))
  if load_path.endswith('.gz'):
   import gzip
   load_path = gzip.open(load_path, 'rb')
  else:
   load_path = open(load_path, 'rb')
 fname = load_path.name
 logger.debug('deserializing object from:  %s', fname)
 try:
  return pickle_load(load_path)
 except AttributeError:
  msg = ('Problems deserializing: %s.  Its possible the interface for this object has changed since being serialized.  You may need to remove and recreate it.' % load_path)
  logger.error(msg)
  raise AttributeError(msg)

def load_obj ( load_path ) : if isinstance ( load_path , str ) : load_path = os . path . expandvars ( os . path . expanduser ( load_path ) ) if load_path . endswith ( '.gz' ) : import gzip load_path = gzip . open ( load_path , 'rb' ) else : load_path = open ( load_path , 'rb' ) fname = load_path . name logger . debug ( 'deserializing object from:  %s' , fname ) try : return pickle_load ( load_path ) except AttributeError : msg = ( 'Problems deserializing: %s.  Its possible the interface for this object has changed since being serialized.  You may need to remove and recreate it.' % load_path ) logger . error ( msg ) raise AttributeError ( msg )
loads a saved on-disk representation to a python data structure .