403Webshell
Server IP : 192.158.238.246  /  Your IP : 13.59.193.179
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3.6/site-packages/jsonschema/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/jsonschema/__pycache__/validators.cpython-36.opt-1.pyc
3

�;XM?�%@s�ddlmZddlZddlZddlZyddlZWnek
rHdZYnXddlmZm	Z	ddl
mZmZm
Z
mZmZmZmZmZmZmZddlmZddlmZmZmZej�ZiZej�Zdd�Zfddfd	d
�Z ddd�Z!e ej"d
�e	j#e	j$e	j%e	j&e	j'e	j(e	j)e	j*e	j+e	j,e	j-e	j.e	j/e	j0e	j1e	j2e	j(e	j3e	j4e	j5e	j6e	j7d�d
d�Z8e ej"d�e	j#e	j$e	j%e	j9e	j:e	j&e	j)e	j+e	j,e	j-e	j.e	j;e	j/e	j0e	j1e	j<e	j2e	j(e	j=e	j>e	j3e	j4e	j?e	j@e	jAe	j7d�dd�ZBGdd�deC�ZDefdd�ZEddd�ZFdS)�)�divisionN)�_utils�_validators)
�Sequence�urljoin�urlsplit�	urldefrag�unquote�urlopen�	str_types�	int_types�	iteritems�	lru_cache)�	ErrorTree)�RefResolutionError�SchemaError�UnknownTypecs�fdd�}|S)a�
    Register the decorated validator for a ``version`` of the specification.

    Registered validators and their meta schemas will be considered when
    parsing ``$schema`` properties' URIs.

    Arguments:

        version (str):

            An identifier to use as the version's name

    Returns:

        callable: a class decorator to decorate the validator with the version

    cs$|t�<d|jkr |t|jd<|S)N�id)�
validators�META_SCHEMA�meta_schemas)�cls)�version�� /usr/lib/python3.6/validators.py�
_validates.s
zvalidates.<locals>._validatesr)rrr)rr�	validatessrcsh�dkr"ttttd�tjttd��G���fdd�dt�}|dk	rdt	|�|�}|j
�jdd�d|_|S)N)ZarrayZbooleanZintegerZnullZnumber�object�stringcsneZdZe��Ze��Ze��Zfddfdd�Zedd��Z	ddd�Z
ddd	�Zd
d�Zdd
�Z
ddd�ZdS)zcreate.<locals>.ValidatorNcSs@t|j�|_|jj|�|dkr*tj|�}||_||_||_dS)N)	�dict�
DEFAULT_TYPES�_types�update�RefResolver�from_schema�resolver�format_checker�schema)�selfr'�typesr%r&rrr�__init__Cs
z"create.<locals>.Validator.__init__cSs(x"||j�j|�D]}tj|��qWdS)N)r�iter_errorsrZcreate_from)rr'�errorrrr�check_schemaPsz&create.<locals>.Validator.check_schemacss�|dkr|j}|jd�}|r(|jj|�z�|jd�}|dk	rHd|fg}nt|�}xr|D]j\}}|jj|�}|dkrtqV|||||�p�f}	x8|	D]0}
|
j||||d�|dkr�|
jj|�|
Vq�WqVWWd|r�|jj	�XdS)Nrz$ref)�	validatorZvalidator_value�instancer')
r'�getr%�
push_scoper
�
VALIDATORSZ_set�schema_path�
appendleft�	pop_scope)r(r/�_schema�scope�refr�k�vr.�errorsr,rrrr+Us4


z%create.<locals>.Validator.iter_errorscssHxB|j||�D]2}|dk	r&|jj|�|dk	r:|jj|�|VqWdS)N)r+�pathr4r3)r(r/r'r<r3r,rrr�descendxsz!create.<locals>.Validator.descendc_sx|j||�D]}|�qWdS)N)r+)r(�args�kwargsr,rrr�validate�sz"create.<locals>.Validator.validatecSsb||jkrt|||j��|j|}t|t�rXtj|�}tdd�|D��}|rXt|krXdSt||�S)Ncss|]}t|tj�VqdS)N)�
issubclass�numbers�Number)�.0Zpytyperrr�	<genexpr>�sz4create.<locals>.Validator.is_type.<locals>.<genexpr>F)r!rr'�
isinstance�boolrZflatten�any)r(r/�typeZpytypesZ	is_numberrrr�is_type�s



z!create.<locals>.Validator.is_typecSst|j||�d�}|dkS)N)�nextr+)r(r/r6r,rrr�is_valid�sz"create.<locals>.Validator.is_valid)N)NN)N)�__name__�
__module__�__qualname__rr2rr r*�classmethodr-r+r=r@rJrLr)�
default_types�meta_schemarrr�	Validator>s
#
rS� �)
�listrGrrIrBrCrrrr�title�replacerM)rRrrrQrSr)rQrRrr�create6sYrYcCs(t|j�}|j|�t|j|||jd�S)N)rRrrrQ)rr2r"rYrr )r.rrZall_validatorsrrr�extend�s

rZZdraft3)z$ref�additionalItems�additionalProperties�dependenciesZdisallowZdivisibleBy�enumZextends�format�items�maxItems�	maxLength�maximum�minItems�	minLength�minimum�
multipleOf�pattern�patternProperties�
propertiesrI�uniqueItems)rRrrZdraft4)z$refr[r\ZallOfZanyOfr]r^r_r`rarbZ
maxPropertiesrcrdreZ
minPropertiesrfrg�notZoneOfrhrirjZrequiredrIrkc@s�eZdZdZfdfddfdd�Zedd��Zdd	�Zd
d�Ze	dd
��Z
e	dd��Zej
dd��Zej
dd��Zdd�Zdd�Zdd�Zdd�ZdS)r#a&
    Resolve JSON References.

    Arguments:

        base_uri (str):

            The URI of the referring document

        referrer:

            The actual referring document

        store (dict):

            A mapping from URIs to documents to cache

        cache_remote (bool):

            Whether remote refs should be cached after first resolution

        handlers (dict):

            A mapping from URI schemes to functions that should be used
            to retrieve them

        urljoin_cache (functools.lru_cache):

            A cache that will be used for caching the results of joining
            the resolution scope to subscopes.

        remote_cache (functools.lru_cache):

            A cache that will be used for caching the results of
            resolved remote URLs.

    TNcCs�|dkrtd�t�}|dkr*td�|j�}||_||_t|�|_|g|_tj	dd�t
t�D��|_|jj
|�||j|<||_||_dS)Nicss|]\}}||jfVqdS)N)r)rDrr.rrrrE$sz'RefResolver.__init__.<locals>.<genexpr>)rr�resolve_from_url�referrer�cache_remoter�handlers�
_scopes_stackr�URIDictr
r�storer"�_urljoin_cache�
_remote_cache)r(�base_urirnrsrorpZ
urljoin_cacheZremote_cacherrrr*s


zRefResolver.__init__cOs||jdd�|f|�|�S)z�
        Construct a resolver from a JSON schema object.

        Arguments:

            schema:

                the referring schema

        Returns:

            :class:`RefResolver`

        rrU)r0)rr'r>r?rrrr$-szRefResolver.from_schemacCs|jj|j|j|��dS)N)rq�appendrt�resolution_scope)r(r7rrrr1@szRefResolver.push_scopecCs0y|jj�Wntk
r*td��YnXdS)NznFailed to pop the scope from an empty stack. `pop_scope()` should only be called once for every `push_scope()`)rq�pop�
IndexErrorr)r(rrrr5Es
zRefResolver.pop_scopecCs
|jdS)N����)rq)r(rrrrxOszRefResolver.resolution_scopecCst|j�\}}|S)N)rrx)r(�uri�_rrrrvSszRefResolver.base_uric
cs$|j|�z
dVWd|j�XdS)N)r1r5)r(r7rrr�in_scopeXs

zRefResolver.in_scopec
cs2|j|�\}}|j|�z
|VWd|j�XdS)z�
        Context manager which resolves a JSON ``ref`` and enters the
        resolution scope of this ref.

        Arguments:

            ref (str):

                The reference to resolve

        N)�resolver1r5)r(r8�urlZresolvedrrr�	resolving`s


zRefResolver.resolvingcCs|j|j|�}||j|�fS)N)rtrxru)r(r8r�rrrr�uszRefResolver.resolvecCsvt|�\}}y|j|}WnNtk
rhy|j|�}Wn*tk
rb}zt|��WYdd}~XnXYnX|j||�S)N)rrs�KeyError�resolve_remote�	Exceptionr�resolve_fragment)r(r��fragment�document�excrrrrmys zRefResolver.resolve_from_urlcCs�|jd�}|rt|�jd�ng}x~|D]v}|jdd�jdd�}t|t�rjyt|�}Wntk
rhYnXy||}Wq&tt	fk
r�t
d|��Yq&Xq&W|S)z�
        Resolve a ``fragment`` within the referenced ``document``.

        Arguments:

            document:

                The referrant document

            fragment (str):

                a URI fragment to resolve within it

        �/z~1z~0�~zUnresolvable JSON pointer: %r)�lstripr	�splitrXrFr�int�
ValueError�	TypeError�LookupErrorr)r(r�r��parts�partrrrr��s


zRefResolver.resolve_fragmentcCs�t|�j}||jkr$|j||�}n`|dkrltrlttjdd�dk	rlttjj�r^tj|�j�}q�tj|�j}ntj	t
|�j�jd��}|j
r�||j|<|S)a�
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: http://pypi.python.org/pypi/requests/

        �http�https�jsonNzutf-8)r�r�)r�schemerp�requests�getattrZResponse�callabler�r0�loadsr
�read�decoderors)r(r}r��resultrrrr��s


zRefResolver.resolve_remote)rMrNrO�__doc__r*rPr$r1r5�propertyrxrv�
contextlib�contextmanagerrr�r�rmr�r�rrrrr#�s"%
%r#cCs |tkrt}tj|jdd�|�S)Nz$schemarU)�_unset�Draft4Validatorrr0)r'�defaultrrr�
validator_for�sr�cOs4|dkrt|�}|j|�||f|�|�j|�dS)av
    Validate an instance under the given schema.

        >>> validate([2, 3, 4], {"maxItems": 2})
        Traceback (most recent call last):
            ...
        ValidationError: [2, 3, 4] is too long

    :func:`validate` will first verify that the provided schema is itself
    valid, since not doing so can lead to less obvious error messages and fail
    in less obvious or consistent ways. If you know you have a valid schema
    already or don't care, you might prefer using the
    :meth:`~IValidator.validate` method directly on a specific validator
    (e.g. :meth:`Draft4Validator.validate`).


    Arguments:

        instance:

            The instance to validate

        schema:

            The schema to validate with

        cls (:class:`IValidator`):

            The class that will be used to validate the instance.

    If the ``cls`` argument is not provided, two things will happen in
    accordance with the specification. First, if the schema has a
    :validator:`$schema` property containing a known meta-schema [#]_ then the
    proper validator will be used.  The specification recommends that all
    schemas contain :validator:`$schema` properties for this reason. If no
    :validator:`$schema` property is found, the default validator class is
    :class:`Draft4Validator`.

    Any other provided positional and keyword arguments will be passed on when
    instantiating the ``cls``.

    Raises:

        :exc:`ValidationError` if the instance is invalid

        :exc:`SchemaError` if the schema itself is invalid

    .. rubric:: Footnotes
    .. [#] known by a validator registered with :func:`validates`
    N)r�r-r@)r/r'rr>r?rrrr@�s3
r@)N)N)GZ
__future__rr�r�rBr��ImportErrorZ
jsonschemarrZjsonschema.compatrrrrr	r
rrr
rZjsonschema.exceptionsrrrrZUnsetr�rrrrrrYrZZload_schemar8r[r\r]Zdisallow_draft3rgr^Zextends_draft3r_r`rarbrcrdrerfrhriZproperties_draft3Ztype_draft3rkZDraft3ValidatorZallOf_draft4ZanyOf_draft4ZmaxProperties_draft4ZminProperties_draft4Z
not_draft4ZoneOf_draft4Zproperties_draft4Zrequired_draft4Ztype_draft4r�rr#r�r@rrrr�<module>s�
0h
z

Youez - 2016 - github.com/yon3zu
LinuXploit