def create_gzip_message(payloads, key=None, compresslevel=None):
 message_set = KafkaProtocol._encode_message_set([create_message(payload, pl_key) for (payload, pl_key) in payloads])
 gzipped = gzip_encode(message_set, compresslevel=compresslevel)
 codec = (ATTRIBUTE_CODEC_MASK & CODEC_GZIP)
 return kafka.structs.Message(0, (0 | codec), key, gzipped)

def create_gzip_message ( payloads , key = None , compresslevel = None ) : message_set = KafkaProtocol . _encode_message_set ( [ create_message ( payload , pl_key ) for ( payload , pl_key ) in payloads ] ) gzipped = gzip_encode ( message_set , compresslevel = compresslevel ) codec = ( ATTRIBUTE_CODEC_MASK & CODEC_GZIP ) return kafka . structs . Message ( 0 , ( 0 | codec ) , key , gzipped )
construct a gzipped message containing multiple messages the given payloads will be encoded .