code: def save_object(filename, obj):
      
      logging.info('saving {}...'.format(filename))
      try:
          with gzip.GzipFile(filename, 'wb') as f:
              f.write(pickle.dumps(obj, 1))
      except Exception as e:
          logging.error('save failure: {}'.format(e))
          raise
docs: Compresses and pickles given object to the given filename.