code: def validator_for(schema, default=_LATEST_VERSION):
      
      if schema is True or schema is False or u"$schema" not in schema:
          return default
      if schema[u"$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[u"$schema"], _LATEST_VERSION)
docs: 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.