code: def ref(validator, ref, instance, schema):
      resolve = getattr(validator.resolver, "resolve", None)
      if resolve is None:
          with validator.resolver.resolving(ref) as resolved:
              for error in validator.descend(instance, resolved):
                  yield error
      else:
          scope, resolved = validator.resolver.resolve(ref)
          validator.resolver.push_scope(scope)
  
          try:
              for error in validator.descend(instance, resolved):
                  yield error
          finally:
              validator.resolver.pop_scope()
  
imports: import re
  from jsonschema._utils import ensure_list, equal, extras_msg, find_additional_properties, types_msg, unbool, uniq
  from jsonschema.exceptions import FormatError, ValidationError
  from jsonschema.compat import iteritems
label_desc: Use image node_id 22 for calling a global function with example usage: ref(validator, ref, instance, schema) without return types