@classmethod
def from_bytes(cls, data):
    (msgid, btag, btaginverse) = struct.unpack_from('BBBx', data)
    if (msgid != MsgID.dev_dep_msg_in):
        warnings.warn("Unexpected MsgID format. Consider updating the device's firmware. See https://github.com/pyvisa/pyvisa-py/issues/20")
        return BulkInMessage.from_quirky(data)
    (transfer_size, transfer_attributes) = struct.unpack_from('<LBxxx', data, 4)
    data = data[12:(12 + transfer_size)]
    return cls(msgid, btag, btaginverse, transfer_size, transfer_attributes, data)
@classmethod
def from_bytes(cls, data):
    (msgid, btag, btaginverse) = struct.unpack_from('BBBx', data)
    if (msgid != MsgID.dev_dep_msg_in):
        warnings.warn("Unexpected MsgID format. Consider updating the device's firmware. See https://github.com/pyvisa/pyvisa-py/issues/20")
        return BulkInMessage.from_quirky(data)
    (transfer_size, transfer_attributes) = struct.unpack_from('<LBxxx', data, 4)
    data = data[12:(12 + transfer_size)]
    return cls(msgid, btag, btaginverse, transfer_size, transfer_attributes, data)