@classmethod
    def parse(cls, data, magic):

        # check magic number
        if data[0:4] != magic:
            raise MessageFormatException('bad magic number')

        # get binary payload
        (length, ) = struct.unpack('<I', data[16:20])
        payload = data[24:24 + length]

        # check the checksum
        checksum = hashlib.sha256(hashlib.sha256(payload).digest()).digest()[:4]
        if data[20:24] != checksum:
            raise MessageFormatException('bad checksum')

        # get the correct class for this message's command
        command = data[4:16].strip(chr(0))
        message_type = cls.MessageTypes.get(command)

        if message_type is None:
            raise UnknownMessageException((command, data) % 'command: %r (%r)')

        # parse the properties using the correct class's parse
        (vl, message) = super(Message, message_type).parse(payload)
        message._magic = magic

        return message
dataset/ETHPy150Open ricmoo/pycoind/pycoind/protocol/messages.py/Message.parse/swapped operands of `%`