<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_frame(cls, frame):
 """Create a KNXMessage object from the frame format."""

        message = cls()

        # Check checksum first
        checksum = 0
        for i in range(0, len(frame) - 1):
            checksum += frame[i]

        if (checksum % 0x100) != frame[len(frame) - 1]:
            raise KNXException('Checksum error in frame {}, '
                               'expected {} but got {}'
                               .format(tohex(frame), frame[len(frame) - 1],
                                       checksum % 0x100))

        message.repeat = (frame[0] >> 5) & 0x01
        message.priority = (frame[0] >> 2) & 0x03
        message.src_addr = (frame[1] << 8) + frame[2]
        message.dst_addr = (frame[3] << 8) + frame[4]
        message.multicast = (frame[5] >> 7)
        message.routing = (frame[5] >> 4) & 0x03
        message.length = frame[5] & 0x0f
        message.data = frame[6:-1]

        if len(message.data) + 1 != message.length:
            raise KNXException(
                'Frame {} has not the correct length'.format(tohex(frame)))

        return message