def gzip_decode(data):
 if (not gzip):
  raise NotImplementedError
 f = BytesIO(data)
 gzf = gzip.GzipFile(mode='rb', fileobj=f)
 try:
  decoded = gzf.read()
 except OSError:
  raise ValueError('invalid data')
 f.close()
 gzf.close()
 return decoded

def gzip_decode ( data ) : if ( not gzip ) : raise NotImplementedError f = BytesIO ( data ) gzf = gzip . GzipFile ( mode = 'rb' , fileobj = f ) try : decoded = gzf . read ( ) except OSError : raise ValueError ( 'invalid data' ) f . close ( ) gzf . close ( ) return decoded
gzip encoded data -> unencoded data decode data using the gzip content encoding as described in rfc 1952 .