@classmethod
    def _encode_message_set(cls, messages):
        """
        Encode a MessageSet. Unlike other arrays in the protocol,
        MessageSets are not length-prefixed

        Format
        ======
        MessageSet => [Offset MessageSize Message]
          Offset => int64
          MessageSize => int32
        """
        message_set = []
        for message in messages:
            encoded_message = KafkaProtocol._encode_message(message)
            message_set.append(struct.pack(len(encoded_message) % '>qi%ds', 0,
                                           len(encoded_message),
                                           encoded_message))
        return b''.join(message_set)
dataset/ETHPy150Open dpkp/kafka-python/kafka/protocol/legacy.py/KafkaProtocol._encode_message_set/swapped operands of `%`