def create_message_set(messages, codec=CODEC_NONE, key=None, compresslevel=None):
 if (codec == CODEC_NONE):
  return [create_message(m, k) for (m, k) in messages]
 elif (codec == CODEC_GZIP):
  return [create_gzip_message(messages, key, compresslevel)]
 elif (codec == CODEC_SNAPPY):
  return [create_snappy_message(messages, key)]
 else:
  raise UnsupportedCodecError(('Codec 0x%02x unsupported' % codec))

def create_message_set ( messages , codec = CODEC_NONE , key = None , compresslevel = None ) : if ( codec == CODEC_NONE ) : return [ create_message ( m , k ) for ( m , k ) in messages ] elif ( codec == CODEC_GZIP ) : return [ create_gzip_message ( messages , key , compresslevel ) ] elif ( codec == CODEC_SNAPPY ) : return [ create_snappy_message ( messages , key ) ] else : raise UnsupportedCodecError ( ( 'Codec 0x%02x unsupported' % codec ) )
create a message set using the given codec .