code: def _encode_message_set(cls, messages, offset=None):
          
          message_set = []
          incr = 1
          if offset is None:
              incr = 0
              offset = 0
          for message in messages:
              encoded_message = KafkaCodec._encode_message(message)
              message_set.append(struct.pack('>qi', offset, len(encoded_message)))
              message_set.append(encoded_message)
              offset += incr
          return b''.join(message_set)
docs: Encode a MessageSet. Unlike other arrays in the protocol,
          MessageSets are not length-prefixed.  Format::
  
              MessageSet => [Offset MessageSize Message]
                Offset => int64
                MessageSize => int32