def METHOD_NAME(frame, direction):
    type_id = int(frame.getfieldval("TypeID"), 16)
    if frame.getfieldval("SQ") == 0:
        if frame.getfieldval("COT") in (2, 3, 5, 11, 12, 20):
            pass
        else:
            raise InvalidFieldValueException(
                "Invalid COT for ASDU type " + str(type_id) + "."
            )
    else:
        raise InvalidFieldValueException(
            "SQ=1 not supported for ASDU type " + str(type_id) + "."
        )