<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lookup(schema):
 """ Lookup a class by property schema. """

    if not isinstance(schema, dict) or "$ref" not in schema:
        return None

    ref = schema["$ref"]

    return REGISTRY.get(ref)