def create_snappy_message(payloads, key=None):
 message_set = KafkaProtocol._encode_message_set([create_message(payload, pl_key) for (payload, pl_key) in payloads])
 snapped = snappy_encode(message_set)
 codec = (ATTRIBUTE_CODEC_MASK & CODEC_SNAPPY)
 return kafka.structs.Message(0, (0 | codec), key, snapped)

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