(load_path)
Loads a saved on-disk representation to a python data structure. We
    currently support the following file formats:

        * python pickle (.pkl)

    Arguments:
        load_path (str): where to the load the serialized object (full path
                            and file name)
Loads a saved on-disk representation to a python data structure. We
    currently support the following file formats:
Loads a saved on - disk representation to a python data structure . We currently support the following file formats :
def load_obj(load_path):
    """
    Loads a saved on-disk representation to a python data structure. We
    currently support the following file formats:

        * python pickle (.pkl)

    Arguments:
        load_path (str): where to the load the serialized object (full path
                            and file name)

    """
    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 )