def compressString(s):
 gzip.time = FakeTime()
 zbuf = BytesIO()
 zfile = gzip.GzipFile(mode='wb', compresslevel=9, fileobj=zbuf)
 zfile.write(s)
 zfile.close()
 return zbuf.getvalue()

def compressString ( s ) : gzip . time = FakeTime ( ) zbuf = BytesIO ( ) zfile = gzip . GzipFile ( mode = 'wb' , compresslevel = 9 , fileobj = zbuf ) zfile . write ( s ) zfile . close ( ) return zbuf . getvalue ( )
gzip a given string .