code: def validator_for(schema, default=_LATEST_VERSION):
      """
      Retrieve the validator class appropriate for validating the given schema.
  
      Uses the :validator:`$schema` property that should be present in the
      given schema to look up the appropriate validator class.
  
      Arguments:
  
          schema (collections.Mapping or bool):
  
              the schema to look at
  
          default:
  
              the default to return if the appropriate validator class
              cannot be determined.
  
              If unprovided, the default is to return the latest supported
              draft.
      """
      if schema is True or schema is False or "$schema" not in schema:
          return default
      if schema["$schema"] not in meta_schemas:
          warn(
              (
                  "The metaschema specified by $schema was not found. "
                  "Using the latest draft to validate, but this will raise "
                  "an error in the future."
              ),
              DeprecationWarning,
              stacklevel=2,
          )
      return meta_schemas.get(schema["$schema"], _LATEST_VERSION)
  
imports: from __future__ import division
  from warnings import warn
  import contextlib
  import json
  import numbers
  from six import add_metaclass
  from jsonschema import _legacy_validators, _types, _utils, _validators, exceptions
  from jsonschema.compat import Sequence, int_types, iteritems, lru_cache, str_types, unquote, urldefrag, urljoin, urlopen, urlsplit
  from jsonschema.exceptions import ErrorTree
label_desc: Use image node_id 8 for calling a global function with example usage: validator_for(schema, default) and returns: meta_schemas, default