def load ( filename ) : if not os . path . exists ( filename ) : LOG . error ( "load object - File '%s' does not exist." , filename ) return None obj = None with open ( filename , 'rb' ) as obj_file : obj = dill . load ( obj_file ) return obj
python load an empty pickle
Load a pickled obj from the filesystem .
def load(filename):
    """Load a pickled obj from the filesystem.

    You better know what you expect from the given pickle, because we don't check it.

    Args:
        filename (str): The filename we load the object from.

    Returns:
        The object we were able to unpickle, else None.
    """
    if not os.path.exists(filename):
        LOG.error("load object - File '%s' does not exist.", filename)
        return None

    obj = None
    with open(filename, 'rb') as obj_file:
        obj = dill.load(obj_file)
    return obj