def compress(body, compress_level):
 import zlib
 (yield '\x1f\x8b')
 (yield '\x08')
 (yield '\x00')
 (yield struct.pack('<L', (int(time.time()) & 4294967295L)))
 (yield '\x02')
 (yield '\xff')
 crc = zlib.crc32('')
 size = 0
 zobj = zlib.compressobj(compress_level, zlib.DEFLATED, (- zlib.MAX_WBITS), zlib.DEF_MEM_LEVEL, 0)
 for line in body:
  size += len(line)
  crc = zlib.crc32(line, crc)
  (yield zobj.compress(line))
 (yield zobj.flush())
 (yield struct.pack('<L', (crc & 4294967295L)))
 (yield struct.pack('<L', (size & 4294967295L)))

def compress ( body , compress_level ) : import zlib ( yield '\x1f\x8b' ) ( yield '\x08' ) ( yield '\x00' ) ( yield struct . pack ( '<L' , ( int ( time . time ( ) ) & 4294967295 L ) ) ) ( yield '\x02' ) ( yield '\xff' ) crc = zlib . crc32 ( '' ) size = 0 zobj = zlib . compressobj ( compress_level , zlib . DEFLATED , ( - zlib . MAX_WBITS ) , zlib . DEF_MEM_LEVEL , 0 ) for line in body : size += len ( line ) crc = zlib . crc32 ( line , crc ) ( yield zobj . compress ( line ) ) ( yield zobj . flush ( ) ) ( yield struct . pack ( '<L' , ( crc & 4294967295 L ) ) ) ( yield struct . pack ( '<L' , ( size & 4294967295 L ) ) )
compress a block of data .