def load_object(filename):
    """Unpickles and decompresses the given filename and returns the created object."""
    logging.info('loading {}...'.format(filename))
    try:
        with gzip.GzipFile(filename, 'rb') as f:
            buf = ''
            while True:
                data = f.read()
                if data == '':
                    break
                buf += data
            return pickle.loads(buf)
    except Exception as e:
        logging.error('load failure: {}'.format(e))
        raise
def load_object ( filename ) : logging . info ( 'loading {}...' . format ( filename ) ) try : with gzip . GzipFile ( filename , 'rb' ) as f : buf = '' while True : data = f . read ( ) if data == '' : break buf += data return pickle . loads ( buf ) except Exception as e : logging . error ( 'load failure: {}' . format ( e ) ) raise
Unpickles and decompresses the given filename and returns the created object.