def METHOD_NAME(self, packet, verify=True):
    packet = packet[self.packet_slice]
    (self.type, self.code, self.checksum, self.id, self.sequence) = struct.unpack(
        "BBHHH", packet[self.header_slice]
    )
    self.data = packet[self.data_slice]
    if verify:
        my_checksum = inet_checksum(packet)
        if my_checksum != 0:
            raise ValueError("unable to verify packet checksum")