HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1991111/root/usr/lib/python3/dist-packages/jsonschema/__pycache__/
Upload File :
Current File : //proc/1991111/root/usr/lib/python3/dist-packages/jsonschema/__pycache__/protocols.cpython-311.pyc
�

�r�c����dZddlmZddlmZmZmZmZddlZej	dkr	ddlm
Z
mZnddlm
Z
mZerddl
Z
ddlmZddlmZeGd	�d
e
����ZdS)z4
typing.Protocol classes for jsonschema interfaces.
�)�annotations)�
TYPE_CHECKING�Any�ClassVar�IteratorN)��)�Protocol�runtime_checkable)�ValidationError)�RefResolverc��eZdZUdZded<ded<ded<ded<d	ed
<		d!d"d�Zed#d���Zd$d�Zd%d�Z	d&d�Z
d'd�Zd(d �ZdS))�	Validatora�
    The protocol to which all validator classes should adhere.

    :argument schema: the schema that the validator object
        will validate with. It is assumed to be valid, and providing
        an invalid schema can lead to undefined behavior. See
        `Validator.check_schema` to validate a schema first.
    :argument resolver: an instance of `jsonschema.RefResolver` that will be
        used to resolve :kw:`$ref` properties (JSON references). If
        unprovided, one will be created.
    :argument format_checker: an instance of `jsonschema.FormatChecker`
        whose `jsonschema.FormatChecker.conforms` method will be called to
        check and see if instances conform to each :kw:`format`
        property present in the schema. If unprovided, no validation
        will be done for :kw:`format`. Certain formats require
        additional packages to be installed (ipv5, uri, color, date-time).
        The required packages can be found at the bottom of this page.
    zClassVar[dict]�META_SCHEMA�
VALIDATORSz ClassVar[jsonschema.TypeChecker]�TYPE_CHECKERz"ClassVar[jsonschema.FormatChecker]�FORMAT_CHECKER�dict | bool�schemaN�resolver�RefResolver | None�format_checker�jsonschema.FormatChecker | None�return�Nonec��dS)N�)�selfrrrs    �6/usr/lib/python3/dist-packages/jsonschema/protocols.py�__init__zValidator.__init__Ys	��	���dictc��dS)z�
        Validate the given schema against the validator's `META_SCHEMA`.

        :raises: `jsonschema.exceptions.SchemaError` if the schema
            is invalid
        Nr)�clsrs  r�check_schemazValidator.check_schemaa����r!�instancer�type�str�boolc��dS)z�
        Check if the instance is of the given (JSON Schema) type.

        :type type: str
        :rtype: bool
        :raises: `jsonschema.exceptions.UnknownType` if ``type``
            is not a known type.
        Nr)rr'r(s   r�is_typezValidator.is_typejr&r!c��dS)z�
        Check if the instance is valid under the current `schema`.

        :rtype: bool

        >>> schema = {"maxItems" : 2}
        >>> Draft202012Validator(schema).is_valid([2, 3, 4])
        False
        Nr�rr's  r�is_validzValidator.is_validtr&r!�Iterator[ValidationError]c��dS)a)
        Lazily yield each of the validation errors in the given instance.

        :rtype: an `collections.abc.Iterable` of
            `jsonschema.exceptions.ValidationError`\s

        >>> schema = {
        ...     "type" : "array",
        ...     "items" : {"enum" : [1, 2, 3]},
        ...     "maxItems" : 2,
        ... }
        >>> v = Draft202012Validator(schema)
        >>> for error in sorted(v.iter_errors([2, 3, 4]), key=str):
        ...     print(error.message)
        4 is not one of [1, 2, 3]
        [2, 3, 4] is too long
        Nrr.s  r�iter_errorszValidator.iter_errorsr&r!c��dS)a{
        Check if the instance is valid under the current `schema`.

        :raises: `jsonschema.exceptions.ValidationError` if the
            instance is invalid

        >>> schema = {"maxItems" : 2}
        >>> Draft202012Validator(schema).validate([2, 3, 4])
        Traceback (most recent call last):
            ...
        ValidationError: [2, 3, 4] is too long
        Nrr.s  r�validatezValidator.validate�r&r!�'Validator'c��dS)al
        Create a new validator like this one, but with given changes.

        Preserves all other attributes, so can be used to e.g. create a
        validator with a different schema but with the same :kw:`$ref`
        resolution behavior.

        >>> validator = Draft202012Validator({})
        >>> validator.evolve(schema={"type": "number"})
        Draft202012Validator(schema={'type': 'number'}, format_checker=None)

        The returned object satisfies the validator protocol, but may not
        be of the same concrete class! In particular this occurs
        when a :kw:`$ref` occurs to a schema with a different
        :kw:`$schema` than this one (i.e. for a different draft).

        >>> validator.evolve(
        ...     schema={"$schema": Draft7Validator.META_SCHEMA["$id"]}
        ... )
        Draft7Validator(schema=..., format_checker=None)
        Nr)r�kwargss  r�evolvezValidator.evolve�r&r!)NN)rrrrrrrr)rr"rr)r'rr(r)rr*)r'r"rr*)r'r"rr0)r'r"rr)rr5)
�__name__�
__module__�__qualname__�__doc__�__annotations__r �classmethodr%r,r/r2r4r8rr!rrr0s���������* ����
����3�2�2�2�7�6�6�6�����
(,�:>�	����������[������	�	�	�	�����&���������r!r)r<�
__future__r�typingrrrr�sys�version_infor
r�typing_extensions�
jsonschema�jsonschema.exceptionsr�jsonschema.validatorsr
rrr!r�<module>rGs����#�"�"�"�"�"�9�9�9�9�9�9�9�9�9�9�9�9�
�
�
�
���v���2�2�2�2�2�2�2�2�2�=�=�=�=�=�=�=�=�������1�1�1�1�1�1�-�-�-�-�-�-��D�D�D�D�D��D�D���D�D�Dr!