(schema, default=_LATEST_VERSION)
return _META_SCHEMAS.get(schema["$schema"], _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.abc.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.
Retrieve the validator class appropriate for validating the given schema.
Retrieve the validator class appropriate for validating the given schema .
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.abc.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)
def validator_for ( schema , default = _LATEST_VERSION ) : 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 )