code: def unpack(cls, data):
          
          header, data = APPHeader.unpack(data)
  
          if len(data) < header.payload_length:
              raise ProtocolViolation("Payload too small")
          payload = data[:header.payload_length]
          body = cls()
          body._header = header
          body._payload = payload
          return body, data[header.payload_length:]
docs: Unpack packed data into an instance
  
          :param data: Packed data
          :type data: str
          :return: Object instance and remaining data
          :rtype: (APPMessage, str)
          :raises ProtocolViolation: Data length smaller than payload length