def gzip_compress(data):
 s = BytesIO()
 g = gzip.GzipFile(fileobj=s, mode='wb')
 g.write(data)
 g.close()
 return s.getvalue()

def gzip_compress ( data ) : s = BytesIO ( ) g = gzip . GzipFile ( fileobj = s , mode = 'wb' ) g . write ( data ) g . close ( ) return s . getvalue ( )
return the gzip-compressed version of the given bytes .