IsModelReferenceTo🔗
Check that the target of the model reference matches the
expectedType.
Code
return (
reference.type == Reference_types.Model_reference
and len(reference.keys) != 0
and reference.keys[-1].type == expected_type
)