ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib64/python3.11/site-packages/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/__pycache__/schema.cpython-311.pyc

�

�܋f
v��T�dZddlZddlZ	ddlmZn#e$r	ddlmZYnwxYwdZgd�ZGd�de	��Z
Gd�d	e
��ZGd
�de
��ZGd�d
e
��Z
Gd�de
��ZGd�de
��ZGd�de��ZGd�de��ZGd�de��ZGd�de��Zed��\ZZZZZZd�Zd�ZGd�de��ZGd�d e��ZGd!�d"e��Z Gd#�d$e ��Z!Gd%�d&e��Z"Gd'�d(e��Z#d)�Z$d*�Z%dS)+z�schema is a library for validating Python data structures, such as those
obtained from config-files, forms, external services or command-line
parsing, converted from JSON/YAML (or something else) to Python data-types.�N)�	ExitStackz0.7.5)�Schema�And�Or�Regex�Optional�Use�	Forbidden�Const�Literal�SchemaError�SchemaWrongKeyError�SchemaMissingKeyError�SchemaForbiddenKeyError�SchemaUnexpectedTypeError�SchemaOnlyOneAllowedErrorc�0�eZdZdZdd�Zed���ZdS)r
zError during Schema validation.Nc���t|��tur|n|g|_t|��tur|n|g|_t�||j��dS�N)�type�list�autos�errors�	Exception�__init__�code)�selfrrs   �=/opt/cloudlinux/venv/lib64/python3.11/site-packages/schema.pyrzSchemaError.__init__%sZ��"�5�k�k�T�1�1�U�U��w��
� $�V���� 4� 4�f�f�6�(������4���+�+�+�+�+�c���d�}|d�|jD����}|d�|jD����}|rd�|��Sd�|��S)zW
        Removes duplicates values in auto and error list.
        parameters.
        c�N���t����j���fd�|D��S)zB
            Utility function that removes duplicate.
            c�2��g|]}|�v��|���|��S�r#)�.0�x�seen�seen_adds  ��r�
<listcomp>z2SchemaError.code.<locals>.uniq.<locals>.<listcomp>8s*���H�H�H�!�a�t�m�m�H�H�Q�K�K�m�A�m�m�mr)�set�add)�seqr&r's @@r�uniqzSchemaError.code.<locals>.uniq1s3�����5�5�D��x�H�H�H�H�H�H�s�H�H�H�Hrc3�K�|]}|�|V��	dSrr#�r$�is  r�	<genexpr>z#SchemaError.code.<locals>.<genexpr>:s"����?�?�a��������?�?rc3�K�|]}|�|V��	dSrr#r.s  rr0z#SchemaError.code.<locals>.<genexpr>;s"����B�B��A�M�!�M�M�M�M�B�Br�
)rr�join)rr,�data_set�
error_lists    rrzSchemaError.code*s���	I�	I�	I��4�?�?�4�:�?�?�?�?�?���T�B�B�T�[�B�B�B�B�B�
��	)��9�9�Z�(�(�(��y�y��"�"�"rr)�__name__�
__module__�__qualname__�__doc__r�propertyrr#rrr
r
"sI������)�)�,�,�,�,�
�#�#��X�#�#�#rr
c��eZdZdZdS)rzXError Should be raised when an unexpected key is detected within the
    data set being.N�r6r7r8r9r#rrrrAs��������	�Drrc��eZdZdZdS)rz`Error should be raised when a mandatory key is not found within the
    data set being validatedNr<r#rrrrHs������ � �	�Drrc��eZdZdZdS)rzOError should be raised when an only_one Or key has multiple matching candidatesNr<r#rrrrOs������Y�Y��Drrc��eZdZdZdS)rz�Error should be raised when a forbidden key is found within the
    data set being validated, and its value matches the value that was specifiedNr<r#rrrrUs������T�T�	�Drrc��eZdZdZdS)rz`Error should be raised when a type mismatch is detected within the
    data set being validated.Nr<r#rrrr\s������!�!�	�Drrc�:�eZdZdZd�Zd�Zed���Zd�ZdS)rzS
    Utility function to combine validation directives in AND Boolean fashion.
    c�r�||_t|���hd���s6hd��|��}t	dt|��z���|�d��|_|�dd��|_|�dt��|_
dS)N>�error�schema�ignore_extra_keyszUnknown keyword arguments %rrCrEFrD)�_argsr)�issubset�
difference�	TypeErrorr�get�_error�_ignore_extra_keysr�_schema)r�args�kw�diffs    rrzAnd.__init__hs�����
��2�w�w��� H� H� H�I�I�	I�;�;�;�F�F�r�J�J�D��:�T�$�Z�Z�G�H�H�H��f�f�W�o�o���"$�&�&�)<�e�"D�"D����v�v�h��/�/����rc�j�|jj�dd�d�|jD�����d�S)N�(�, c3�4K�|]}t|��V��dSr��repr)r$�as  rr0zAnd.__repr__.<locals>.<genexpr>ss(����=Z�=Z�!�d�1�g�g�=Z�=Z�=Z�=Z�=Z�=Zr�))�	__class__r6r3rF�rs r�__repr__zAnd.__repr__rs;���>�2�2�2�D�I�I�=Z�=Z�t�z�=Z�=Z�=Z�4Z�4Z�4Z�4Z�[�[rc��|jS)zThe provided parameters)rFrZs rrNzAnd.argsus���z�rc�P���fd��jD��D]}|j|fi|��}�|S)z�
        Validate data using defined sub schema/expressions ensuring all
        values are valid.
        :param data: to be validated with sub defined schemas.
        :return: returns validated data
        c�T��g|]$}��|�j�j�����%S��rCrE�rMrKrL�r$�srs  �rr(z And.validate.<locals>.<listcomp>��1���t�t�t�de�$�,�,�q���t�G^�,�_�_�t�t�tr)rF�validate)r�data�kwargsrcs`   rrezAnd.validatezsM���u�t�t�t�im�is�t�t�t�	.�	.�A��1�:�d�-�-�f�-�-�D�D��rN)	r6r7r8r9rr[r:rNrer#rrrrcsi��������0�0�0�\�\�\�����X��	�	�	�	�	rrc�.��eZdZdZ�fd�Zd�Zd�Z�xZS)rzNUtility function to combine validation directives in a OR Boolean
    fashion.c���|�dd��|_d|_tt|��j|i|��dS)N�only_oneFr)�poprj�match_count�superrr�rrNrgrYs   �rrzOr.__init__�sF����
�
�:�u�5�5��
���� ��b�$��� �$�1�&�1�1�1�1�1rc�h�|jdko|j}d|_|rtdd|zzg���dS)N�rz There are multiple keys present zfrom the %r condition)rlrjr)r�faileds  r�resetzOr.reset�sQ���!�A�%�7�$�-������	s�+�-O�Ri�lp�Rp�-p�,q�r�r�r�	s�	src�v��gg}}�fd��jD��D]c}	|j|fi|��}�xjdz
c_�jdkr	�jrn/|cS#t$r}||jz
}||jz
}Yd}~�\d}~wwxYwt	��d|��g|z�jr�j�|��ndg|z���)z�
        Validate data using sub defined schema/expressions ensuring at least
        one value is valid.
        :param data: data to be validated by provided schema.
        :return: return validated data if not validation
        c�T��g|]$}��|�j�j�����%Sr_rarbs  �rr(zOr.validate.<locals>.<listcomp>�rdrrpNz did not validate )	rFrerlrjr
rrrK�format)rrfrgrrrc�
validation�_xs`       rrezOr.validate�s����B�v��t�t�t�t�im�is�t�t�t�		$�		$�A�
$�'�Q�Z��7�7��7�7�
�� � �A�%� � ��#�a�'�'�D�M�'��E�!�!�!�!���
$�
$�
$����!���"�)�#�����������
$�����)-���t�t�
4�5��=�)-��
>�T�[�
�
��
%�
%�
%�$�?�&�H�
�
�	
s�0A�A�
A:�A5�5A:)r6r7r8r9rrrre�
__classcell__�rYs@rrr�sc���������2�2�2�2�2�
s�s�s�
�
�
�
�
�
�
rrc�D�eZdZdZgd�Zd	d�Zd�Zed���Zd�Z	dS)
rzI
    Enables schema.py to validate string using regular expressions.
    )	zre.ASCIIzre.DEBUGz
re.VERBOSEz
re.UNICODEz	re.DOTALLzre.MULTILINEz	re.LOCALEz
re.IGNORECASEzre.TEMPLATErNc��||_d�td�t|������D��}|rdd�|��z|_nd|_t
j||���|_||_	dS)Nc�D�g|]\}}|dk�tj|��S)�0)r�NAMES)r$r/�fs   rr(z"Regex.__init__.<locals>.<listcomp>�s5��
�
�
�#�q�!�RS�WZ�RZ�RZ�E�K��N�RZ�RZ�RZrz{0:09b}z, flags=�|�)�flags)
�_pattern_str�	enumerateru�intr3�_flags_names�re�compile�_patternrK)r�pattern_strr�rC�
flags_lists     rrzRegex.__init__�s���'���
�
�'0��1A�1A�#�e�*�*�1M�1M�'N�'N�
�
�
�
��	#� *�S�X�X�j�-A�-A� A�D��� "�D���
�;�e�<�<�<��
�����rc�>�|jj�d|j�|j�d�S�NrRrX)rYr6r�r�rZs rr[zRegex.__repr__�s)��!�^�4�4�4�d�6G�6G��IZ�IZ�IZ�[�[rc��|jS)z2The pattern for the represented regular expression)r�rZs rr�zRegex.pattern_str�s
��� � rc���|j}	|j�|��r|St|�d|��|r|�|��nd���#t
$rtd|z|���wxYw)z�
        Validated data using defined regex.
        :param data: data to be validated
        :return: return validated data.
        � does not match Nz%r is not string nor buffer)rKr��searchr
rurI)rrfrg�es    rrezRegex.validate�s���
�K��	G��}�#�#�D�)�)�
h���!�D�D�D�$�$�"G�[\�If����RV����bf�g�g�g���	G�	G�	G��;�d�B�A�F�F�F�	G���s�A�,A�A/)rN)
r6r7r8r9r~rr[r:r�rer#rrrr�s���������


�

�

�E�����\�\�\��!�!��X�!�G�G�G�G�Grrc�&�eZdZdZdd�Zd�Zd�ZdS)r	zu
    For more general use cases, you can use the Use class to transform
    the data while it is being validate.
    Nc�d�t|��std|z���||_||_dS)NzExpected a callable, not %r)�callablerI�	_callablerK)r�	callable_rCs   rrzUse.__init__�s9���	�"�"�	G��9�I�E�F�F�F�"�������rc�0�|jj�d|j�d�Sr�)rYr6r�rZs rr[zUse.__repr__�s���>�2�2�2�D�N�N�N�C�Crc��	|�|��S#t$rH}tdg|jz|jr|j�|��ndg|jz���d}~wt$rR}t|j��}t|�d|�d|��|jr|j�|��nd���d}~wwxYw)NrR�	) raised )r�r
rrKrur�
BaseException�
_callable_str)rrfrgr%rs     rrezUse.validate�s���	t��>�>�$�'�'�'���	p�	p�	p��t�f�q�w�.�T�[�1b���1C�1C�D�1I�1I�1I�^b�0c�fg�fn�0n�o�o�o������	t�	t�	t��d�n�-�-�A��A�A�A�t�t�t�Q�Q�?�]a�]h�Ar���AS�AS�TX�AY�AY�AY�nr�s�s�s�����	t���s"��
C�AA$�$
C�1A
B>�>Cr)r6r7r8r9rr[rer#rrr	r	�sX��������
����D�D�D�t�t�t�t�trr	�c��t|��ttttfvrt
St|��turtStt|��t��rtSt|t��rtSt|d��rtSt|��rt StS)z#Return priority for a given object.re)rr�tupler)�	frozenset�ITERABLE�dict�DICT�
issubclass�TYPE�
isinstancer�
COMPARABLE�hasattr�	VALIDATORr��CALLABLE�rcs r�	_priorityr�s����A�w�w�4���Y�/�/�/����A�w�w�$������$�q�'�'�4� � �����!�W�������q�*��������{�{�����rc�~�tj|��}t|j��dkr
|��S|di|��S)Nrr#)�inspect�	signature�len�
parameters)rrgrcs   r�_invoke_with_optional_kwargsr�sD����!���A�
�1�<���A����q�s�s�
��1�;�;�v�;�;�rc��eZdZdZdd�Zd�Zed���Zed���Zed���Z	ed	���Z
ed
���Zed���Z
d�Zd
�Zd�Zdd�ZdS)rz~
    Entry point of the library, use this class to instantiate validation
    schema for the data that will be validated.
    NFc��||_||_||_||_||_||_|r|�t
d���dSdS)Nz+Schema used as reference should have a name)rMrKrL�_name�_description�as_reference�
ValueError)rrDrCrE�name�descriptionr�s       rrzSchema.__init__!s[��������"3�����
�'���(����	L�D�L��J�K�K�K�	L�	L�L�Lrc�0�|jj�d|j�d�Sr�)rYr6rMrZs rr[zSchema.__repr__,s���>�2�2�2�D�L�L�L�A�Arc��|jSr�rMrZs rrDz
Schema.schema/�
���|�rc��|jSr�r�rZs rr�zSchema.description3���� � rc��|jSr)r�rZs rr�zSchema.name7s
���z�rc��|jSr)rLrZs rrEzSchema.ignore_extra_keys;s���&�&rc���t|t��rt|j��dz
St|t��rt|j��dzSt|��S)z'Return priority for a given key object.g�?)r��Hookr�rMrr�s r�_dict_key_priorityzSchema._dict_key_priority?s^���a����	.��Q�Y�'�'�#�-�-��a��"�"�	.��Q�Y�'�'�#�-�-���|�|�rc�R��t�fd�ttfD����S)zDReturn True if the given key is optional (does not have to be found)c3�8�K�|]}t�|��V��dSr�r�)r$�
optional_typercs  �rr0z+Schema._is_optional_type.<locals>.<genexpr>Ks-�����V�V�M�:�a��/�/�V�V�V�V�V�Vr)�anyrr�r�s`r�_is_optional_typezSchema._is_optional_typeHs.����V�V�V�V�h�PT�EU�V�V�V�V�V�Vrc�F�	|j|fi|��dS#t$rYdSwxYw)zvReturn whether the given data has passed all the validations
        that were specified in the given schema.
        TF)rer
)rrfrgs   r�is_validzSchema.is_validMsL��	��D�M�$�)�)�&�)�)�)��4���	�	�	��5�5�	���s��
 � c�J�|jrd�|j|��}|S)z�
        If a custom schema name has been defined, prepends it to the error
        message that gets raised when a schema error occurs.
        z{0!r} {1!s})r�ru)r�messages  r�_prepend_schema_namezSchema._prepend_schema_nameXs+��
�:�	@�#�*�*�4�:�w�?�?�G��rc
������j}�j}�j}�j}t	|t
��r|j}t|��}|tkrY|t|��|���j
|fi���}t||||d���t|����fd�|D����S|tk�r
t��}|t|���j
|fi���}t|����}	t��}
t!|�j���}|D],}t%|d��r|�|j���-|5t!|���d����}
|
D�]2\}}|D�](}||}	|||���j
|fi���}t	|t,��rC	|||���j
|fi���}n#t.$rY�awxYw|�|||���}	||||���j
|fi���}||	|<|
�|��nv#t.$rX}d|z}��|��}t/|g|jz|r|�|��ndg|jz���d}~wwxYw#t.$rY��&wxYw��4	ddd��n#1swxYwYt�fd	�|D����}|�|
��s�||
z
}d
�d�t!|t@���D����}dtC|���d
|��}��|��}tE||r|�|��nd����js�tG|	��tG|��kr�t|�$����t|	�$����z
}d
�d�t!|t@���D����}dtC|���d|�d|��}��|��}tK||r|�|��nd���td�|D����|
z
}|D]7}tM|j'��rtQ|j'fi���n|j'|	|j)<�8|	S|tTkrzt	||��r"t	|tV��r|tXks|S|�d|j-��}��|��}t]||r|�|��nd���|t^kr�	|j
|fi���S#t.$r>}t/dg|jz|r|�|��ndg|jz���d}~wt`$rK}|�d|�d|��}��|��}t/||r|�|��nd���d}~wwxYw|tbk�rte|��}	||��r|Sn�#t.$r>}t/dg|jz|r|�|��ndg|jz���d}~wt`$rK}|�d|�d|��}��|��}t/||r|�|��nd���d}~wwxYw|�d|�d�}��|��}t/||r|�|��nd���||kr|S|�d|��}��|��}t/||r|�|��nd���)N)rC)rCrDrEc3�4�K�|]}�j|fi���V��dSr)re)r$�drg�os  ��rr0z"Schema.validate.<locals>.<genexpr>ns7�����D�D�!�j�a�j��5�5�f�5�5�D�D�D�D�D�Dr)�keyrrc�8�t|dt��S)Nrp)r�r���values r�<lambda>z!Schema.validate.<locals>.<lambda>|s��J�u�UV�x�Y]�D^�D^�rr`zKey '%s' error:c3�F�K�|]}��|���|V��dSr)r�)r$�krs  �rr0z"Schema.validate.<locals>.<genexpr>�s6�����I�I��t�/E�/E�a�/H�/H�I�1�I�I�I�I�I�IrrSc3�4K�|]}t|��V��dSrrU�r$r�s  rr0z"Schema.validate.<locals>.<genexpr>�s(����*[�*[�q�4��7�7�*[�*[�*[�*[�*[�*[rzMissing keyz: c3�4K�|]}t|��V��dSrrUr�s  rr0z"Schema.validate.<locals>.<genexpr>�s(����(W�(W�Q��a���(W�(W�(W�(W�(W�(Wrz	Wrong key� � in c3�dK�|]+}t|t���t|d���'|V��,dS)�defaultN)r�rr�r�s  rr0z"Schema.validate.<locals>.<genexpr>�sA����]�]��:�a��+B�+B�]�w�q�R[�G\�G\�]�1�]�]�]�]�]�]rz should be instance of z
.validate(r�rRz) should evaluate to Truer�)3rYrMrKrLr�rrDr�r�rrerr�rr�r)�sortedr�r��callbackrr�itemsr�r
�handlerr*r�rrurrGr3rV�	_plural_srr��keysrr�r�r�r�r��boolr�r6rr�r�r�r�)rrfrgrrcr�r/�flavor�	exitstack�new�coverage�sorted_skeys�skey�
data_itemsr�r��svalue�nkey�nvaluer%r�r��required�missing_keys�s_missing_keys�
wrong_keys�s_wrong_keys�defaultsr�rr�s` `                           @rrezSchema.validateas����������L���K���#���a��!�!�	���A��1�����X���4�6�6�$�q�'�'��+�+�+�4�T�D�D�V�D�D�D��A�Q�v��C�C�C�A��4��:�:�D�D�D�D�D�t�D�D�D�D�D�D��T�>�>�!���I�1�6�6�$�a�(�(�(�1�$�A�A�&�A�A�D��$�t�*�*�,�,�C��u�u�H�!�!��)@�A�A�A�L�$�
3�
3���4��)�)�3��&�&�t�z�2�2�2���#
*�#
*�#�D�J�J�L�L�6^�6^�_�_�_�
�",� *� *�J�C�� ,�*�*��!"�4���*�#A�6�6�$�a�#8�#8�#8�#A�#�#P�#P��#P�#P�D� *�$��5�5�*�!-�-M�V�V�F�!�-D�-D�-D�-M�e�-^�-^�W]�-^�-^�F�F��'2�!-�!-�!-�$,�H�!-���� $���T�4�� ;� ;� ;� ;�	!*�-b�V�V�F�!�WX�-Y�-Y�-Y�-b�ch�-s�-s�lr�-s�-s�F�17�C��I�$,�L�L��$6�$6�$6�$)�E��(3�!w�!w�!w�(9�D�(@�A�.2�.G�.G��.J�.J�G�*5�w�i�!�'�6I�^_�Li�A�H�H�UY�N�N�N�ei�Kj�mn�mu�Ku�*v�*v�$v�����!w�����) +�!�!�!� �D�!����� *�#
*�#
*�#
*�#
*�#
*�#
*�#
*�#
*�#
*�#
*�#
*����#
*�#
*�#
*�#
*�H�I�I�I�I�a�I�I�I�I�I�H��$�$�X�.�.�
T�'�(�2��!%���*[�*[�F�<�UY�<Z�<Z�<Z�*[�*[�*[�![�![���1:�<�1H�1H�1H�1H�.�.�Y���3�3�G�<�<��+�G�q�5R�Q�X�X�d�^�^�^�d�S�S�S��*�
R��C���C��I�I�0E�0E� ������-�-��C�H�H�J�J���?�
�#�y�y�(W�(W�&��QU�:V�:V�:V�(W�(W�(W�W�W���4=�j�4I�4I�4I�4I�<�<�<�Y]�Y]�^���3�3�G�<�<��)�'�Q�3P�1�8�8�D�>�>�>�D�Q�Q�Q��]�]�a�]�]�]�]�]�`h�h�H�#�
M�
M��^f�gn�gv�^w�^w�$M�#?���#Z�#Z�SY�#Z�#Z�#Z�~E�~M��G�K� � ��J��T�>�>��$��"�"�
X�J�t�T�,B�,B�
X�q�C�x�x���;?�4�4����L���3�3�G�<�<��/��1�9V����$����RV�W�W�W��Y���
J�!�q�z�$�1�1�&�1�1�1���
`�
`�
`�!�4�&�1�7�"2�q�5R�Q�X�X�d�^�^�^�d�4S�VW�V^�4^�_�_�_����� �
J�
J�
J�9:���D�D�D�!�!�D���3�3�G�<�<��!�'�Q�+H�1�8�8�D�>�>�>�D�I�I�I�����
J�����X����a� � �A�
J��1�T�7�7� ��K� ���
`�
`�
`�!�4�&�1�7�"2�q�5R�Q�X�X�d�^�^�^�d�4S�VW�V^�4^�_�_�_����� �
J�
J�
J�01���4�4�4���;���3�3�G�<�<��!�'�Q�+H�1�8�8�D�>�>�>�D�I�I�I�����
J����;<�!�!�T�T�T�B�G��/�/��8�8�G��g��'D�q�x�x��~�~�~��E�E�E���9�9��K�01���4�4�8�G��/�/��8�8�G��g��'D�q�x�x��~�~�~��E�E�Es��:J;�J�'J;�=G�J;�
G$	�!J;�#G$	�$J;�H6�J;�6
J	�AJ	�J	�J;�
J)	�%J;�(J)	�)J;�;J?�J?�
U'�'
X�19V*�*
X�7AW=�=X�!X/�/
[
�99Y2�2
[
�?A[�[
c�`��������t���i�d�������fd�	���d��S)a�Generate a draft-07 JSON schema dict representing the Schema.
        This method must be called with a schema_id.

        :param schema_id: The value of the $id on the main schema
        :param use_refs: Enable reusing object references in the resulting JSON schema.
                         Schemas with references are harder to read by humans, but are a lot smaller when there
                         is a lot of reuse
        TNc	��	���������$j����#�%fd�}d�}d�}�fd�}|j}|j}	t|��}
i�|p|j}|r|�d<|r?|jr8|j� vr i� |j<�|dd���� |j<d|jz�d	<�n�|
tkr||���d
<�n�|
tkrod�d
<t|��dkr"�||d
|	��d����d<�n�t|��dkr ��t|���d����d<�nYt|t��r�td�d�|j
D��D����rAd�|j
D��}t|��dkr||d
���d<�S|�d<�n�g}
|j
D]8}�|||	��d���}|ikr||
vr|
�|���9t|
��dkr��|
d
���ni|
�d<�nbt|t ��ryg}|j
D]8}�|||	��d���}|ikr||vr|�|���9t|��dkr��|d
���n�|�d<�n�|
t"kr||���d<�n�|
t$kr)t'|��t(krd�d
<|j�d<�n�|
t,kr�Sg}i}|	}|D�]T}t|t.��r��fd���fd���fd��|p
�|��}||||	���}�|��}t|t0��r�t|t2��s|�|���|d�|�����||<t|t2��rOt5|d��r?|t7|j��rt;|jfi�!��n|j��||d<��t|t��r-|j
D]%}�|d�|�����|�|��<�&��V��d|||d ����rU���"d!d"����$jr
�$j�d#<� r*i�d$<� ���D]\}}|�d$|<�|���S)%Nc�����r�r�Sttt|���������}|�vr|�|<|Sdt	|��z}|�|d<d|iS)z�If not already seen, return the provided part of the schema unchanged.
                If already seen, give an id to the already seen dict and return a reference to the previous part
                of the schema instead.
                �#�$id�$ref)�hashrVr�r��str)�return_dict�hashed�id_str�is_main_schema�
return_schemar&�use_refss   ����r�_create_or_use_refzDSchema.json_schema.<locals>._json_schema.<locals>._create_or_use_ref�s����
 �)�>�)�(�(��d�6�+�*;�*;�*=�*=�#>�#>�?�?�@�@����%�%�#.�D��L�&�&� �3�v�;�;�.�F�*0�D��L��'�"�F�+�+rc��|tkrdS|tkrdS|tkrdS|tkrdS|tkrdS|t
krdSdS)z-Return the JSON schema name for a Python type�string�integer�number�boolean�array�object)rr��floatr�rr�)�python_types r�_get_type_namez@Schema.json_schema.<locals>._json_schema.<locals>._get_type_name�sg���#�%�%�#�8� �C�'�'�$�9� �E�)�)�#�8� �D�(�(�$�9� �D�(�(�"�7� �D�(�(�#�8��xrc�.�|�5t|��ttttt
tfvr|St|��tttfvrt|��St|t��r|jSt|��S)z\Attempt to convert a constant value (for "const" and "default") to a JSON serializable value)
rrr�rr�rr�r�r)r�r�rrDr�s r�
_to_json_typez?Schema.json_schema.<locals>._json_schema.<locals>._to_json_type	st���=�D��K�K�C��e�T�4�QU�3V�$V�$V� �L���;�;�5�#�y�"9�9�9���;�;�&��e�W�-�-�(� �<�'��5�z�z�!rc�B��t|���s
�||���S|S)N�rEr�)rcrErs  �r�
_to_schemaz<Schema.json_schema.<locals>._json_schema.<locals>._to_schemas1���!�!�V�,�,�J�!�6�!�7H�I�I�I�I��rr�F)r�allow_referencez#/definitions/rrrrpr)rr�c3�,K�|]}|tkV��dSr)r�)r$�prioritys  rr0z;Schema.json_schema.<locals>._json_schema.<locals>.<genexpr>>s'����i�i�h�8�z�1�i�i�i�i�i�irc�,�g|]}t|����Sr#)r�)r$r�s  rr(z<Schema.json_schema.<locals>._json_schema.<locals>.<listcomp>>s!��Bh�Bh�Bh�X]�9�U�CS�CS�Bh�Bh�Bhrc�Z�g|](}t|t��rt|��n|��)Sr#)r�rr)r$rcs  rr(z<Schema.json_schema.<locals>._json_schema.<locals>.<listcomp>?s2��$]�$]�$]�QR�z�!�W�/E�/E�%L�S��V�V�V�1�$]�$]�$]r�const�enum�anyOf�allOfr�patternc�z��t|t��r�|j��S|tkp
|tkS)z=Check if a key is broad enough to allow additional properties)r�rrDrr)r��!_key_allows_additional_propertiess �rr$zSSchema.json_schema.<locals>._json_schema.<locals>._key_allows_additional_propertiesps<���)�#�x�8�8�U�'H�'H���'T�'T� T�#&�#�:�#>����>rc���t|t��r�|j��St|t��r|jSdS)zhGet the description associated to a key (as specified in a Literal object). Return None if not a LiteralN)r�rrDrr�)r��_get_key_descriptions �rr&zFSchema.json_schema.<locals>._json_schema.<locals>._get_key_descriptionwsH���)�#�x�8�8�H�';�';�C�J�'G�'G� G�)�#�w�7�7�7�'*�� 6�#'�4rc���t|t��r�|j��St|t��r|jS|S)zcGet the name of a key (as specified in a Literal object). Return the key unchanged if not a Literal)r�rrDr)r��
_get_key_names �rr(z?Schema.json_schema.<locals>._json_schema.<locals>._get_key_name�sG���)�#�x�8�8�A�'4�}�S�Z�'@�'@� @�)�#�w�7�7�2�'*�z� 1�#&�Jrr)rr�r�r)r�
propertiesr��additionalPropertiesz'http://json-schema.org/draft-07/schema#)r�z$schema�title�definitions) rYrDrEr�r�r�r�r�r�r�rr��allrN�append�updaterr�r�rrr�r�r�rrr�r�r�r�r�r�)&rDrr�rr	rrrrcr/r��return_description�	or_values�
any_of_values�or_key�	new_value�
all_of_values�and_key�
required_keys�expanded_schema�additional_propertiesr��
sub_schema�key_name�definition_name�
definitionrr&r(r$r�_json_schema�definitions_by_namerg�	schema_idr&rrs& `                        @@@@@�������rr>z(Schema.json_schema.<locals>._json_schema�s����������^�F�
,�
,�
,�
,�
,�
,�
,�
,�$
 �
 �
 � 
"�
"�
"�
�
�
�
�
��
�A��(�A��q�\�\�F��M�!,�!B��0B��!�
B�/A�
�m�,��@
�6�#6�@
��;�&9�9�9�79�'���4�7C�|�F�[`�rw�7x�7x�7x�'���4�(8�6�;�(F�
�f�%�%��T�>�>�,:�N�1�,=�,=�M�&�)�)��x�'�'�-4�M�&�)��1�v�v��{�{�1=��j�j��1��q�>Q�>Q�bg�1h�1h�1h�
�g�.�.��Q���!���1=��f�f�R��V�n�n�]b�1c�1c�1c�
�g�.����2�&�&�m��i�i�Bh�Bh�ab�ag�Bh�Bh�Bh�i�i�i�i�i�C�$]�$]�VW�V\�$]�$]�$]�	��y�>�>�Q�.�.�5B�]�9�Q�<�5P�5P�M�'�2�#0�0�09�
�f�-�-�)+�
�&'�f�@�@�F�(4��Z�Z���5J�5J�[`�(a�(a�(a�I�(�B���9�M�3Q�3Q� -� 4� 4�Y� ?� ?� ?���}�-�-��2�2�)�0�0��q�1A�B�B�B�B�5B�M�'�2�2���3�'�'�V�$&�M�#$�6�<�<��$0�L���G�Q�1G�1G�X]�$^�$^�$^�	�$��?�?�y�
�/M�/M�)�0�0��;�;�;���=�)�)�Q�.�.�%�,�,�]�1�-=�>�>�>�>�1>�
�g�.�.��z�)�)�-:�]�1�-=�-=�M�'�*�*��y�(�(�T�!�W�W��-=�-=�,4�M�&�)�/0�}�M�)�,�,���~�~�,�,�%'�M�&(�O�,-�)� �2"�2"��%�c�4�0�0�%�$�?�?�?�?�?�(�(�(�(�(�'�'�'�'�'�1F�0o�Ij�Ij�kn�Io�Io�-�%/�Z��#��!�%L�%L�%L�
�#0�=��#5�#5��%�h��4�4�"�#-�c�8�#<�#<�?� -� 4� 4�X� >� >� >�8D�� *�5�Nb�Nb�cf�Ng�Ng�9�9�9�O�H�5� *�#�x�8�8�t�W�S�)�=T�=T�t�GT�}�MU�VY�Va�Mb�Mb�Vs�Uq�ru�r}�VI�VI�BH�VI�VI�VI�hk�hs�Ht�Ht��� 9�)� D��'��"�5�5�"�+3�-�"�"��IU��$.�u�Rf�Rf�gm�Rn�Rn�J"�J"�J"��
�
�f�0E�0E� F� F��"�(�(�$,�*9�(5�4I�	������
S��$�$�Y�Cl�%m�%m�n�n�n��:�8�-1�Z�M�'�*�&�S�35�M�-�0�7J�7P�7P�7R�7R�S�S�3���HR�
�m�4�_�E�E�%�%�m�4�4�4r)TNT)r�)rr@rrgr>r?r&s````@@@r�json_schemazSchema.json_schema�sw����������v�v�� ��O	5�O	5�O	5�O	5�O	5�O	5�O	5�O	5�O	5�O	5�O	5�O	5�b�|�D�$�'�'�'r)NFNNF)F)r6r7r8r9rr[r:rDr�r�rE�staticmethodr�r�r�r�rerAr#rrrrs;��������
	L�	L�	L�	L�B�B�B�����X���!�!��X�!�����X���'�'��X�'�����\���W�W��\�W�	�	�	����tF�tF�tF�l^(�^(�^(�^(�^(�^(rrc�H��eZdZdZe��Z�fd�Zd�Zd�Zd�Z	�xZ
S)rz5Marker for an optional part of the validation Schema.c�>��|�d|j��}tt|��j|i|��||jurWt|j��tkrtd|j�d����||_	t|j��|_dSdS)Nr�zaOptional keys with defaults must have simple, predictable values, like literal strings or ints. "z" is too complex.)rk�_MARKERrmrrr�rMr�rIr�rr�)rrNrgr�rYs    �rrzOptional.__init__�s�����*�*�Y���5�5��&��h����&��7��7�7�7��$�,�&�&����&�&�*�4�4��i�/3�l�l�l�=����
#�D�L��4�<�(�(�D�H�H�H�'�&rc�*�t|j��Sr)rrMrZs r�__hash__zOptional.__hash__�s���D�L�!�!�!rc��|j|juo=t|d|j��t|d|j��ko|j|jkS)Nr�)rY�getattrrErM)r�others  r�__eq__zOptional.__eq__�sO���N�e�o�-�
.���i���6�6�'�%��TX�T`�:a�:a�a�
.����
�-�	
rc�f�t|jd��r|j���dSdS)Nrr)r�rMrrrZs rrrzOptional.reset�s:���4�<��)�)�	!��L��� � � � � �	!�	!r)r6r7r8r9rrErrGrKrrrxrys@rrr�sv�������?�?��f�h�h�G�)�)�)�)�)�"�"�"�
�
�
�!�!�!�!�!�!�!rrc���eZdZ�fd�Z�xZS)r�c���|�dd���|_tt|��j|i|��|j|_dS)Nr�c��dSrr#)rNs rr�zHook.__init__.<locals>.<lambda>�s��4�r)rkr�rmr�rrMr�rns   �rrz
Hook.__init__�sK����z�z�)�-?�-?�@�@���"��d�D���"�D�3�F�3�3�3��<����r)r6r7r8rrxrys@rr�r��s8������� � � � � � � � � rr�c�4��eZdZ�fd�Zed���Z�xZS)r
c�\��|j|d<tt|��j|i|��dS)Nr�)�_default_functionrmr
rrns   �rrzForbidden.__init__�s8��� �2��y��'��i����'��8��8�8�8�8�8rc�.�td|�d|��|���)NzForbidden key encountered: r�)r)r�rfrCs   rrRzForbidden._default_function�s#��%�%�t�t�t�UY�UY�&Z�\a�b�b�br)r6r7r8rrBrRrxrys@rr
r
�sZ�������9�9�9�9�9��c�c��\�c�c�c�c�crr
c�N�eZdZdd�Zd�Zd�Zed���Zed���ZdS)rNc�"�||_||_dSr)rMr�)rr�r�s   rrzLiteral.__init__�s�����'����rc��|jSrr�rZs r�__str__zLiteral.__str__�s
���|�rc�6�d|jzdz|jpdzdzS)Nz	Literal("z", description="r�z"))rDr�rZs rr[zLiteral.__repr__�s)���T�[�(�+=�=��AQ�AW�UW�X�[_�_�_rc��|jSrr�rZs rr�zLiteral.description�r�rc��|jSrr�rZs rrDzLiteral.schema�r�rr)	r6r7r8rrWr[r:r�rDr#rrrr�s������(�(�(�(����`�`�`��!�!��X�!�����X���rrc���eZdZ�fd�Z�xZS)rc�J��tt|��j|fi|��|Sr)rmrre)rrfrgrYs   �rrezConst.validates-���#��e�T���#�D�3�3�F�3�3�3��r)r6r7r8rerxrys@rrr�s8���������������rrc�N�t|d��r|jSt|��S)Nr6)r�r6r)r�s rr�r�s)���y�*�%�%�"��!�!��y�>�>�rc�0�t|��dkrdndS)Nrprcr�)r�)�sizeds rr�r�s���e�*�*�q�.�.�3�3�b�(r)&r9r�r��
contextlibr�ImportError�contextlib2�__version__�__all__rr
rrrrrrrrrr	�ranger�r�r�r�r�r�r�r�rrr�r
rrr�r�r#rr�<module>rfs���O�O�����	�	�	�	�&�$�$�$�$�$�$�$���&�&�&�%�%�%�%�%�%�%�%�&����������&#�#�#�#�#�)�#�#�#�>	�	�	�	�	�+�	�	�	�	�	�	�	�	�K�	�	�	�	�	�	�	�	��	�	�	�	�	�	�	�	�k�	�	�	�	�	�	�	�	��	�	�	� � � � � �&� � � �F$
�$
�$
�$
�$
��$
�$
�$
�N6G�6G�6G�6G�6G�F�6G�6G�6G�rt�t�t�t�t�&�t�t�t�29>��a���5�
�H�i��t�X����$���Z(�Z(�Z(�Z(�Z(�V�Z(�Z(�Z(�z!�!�!�!�!�v�!�!�!�D � � � � �6� � � �c�c�c�c�c��c�c�c������f����(�����F�������)�)�)�)�)s��!�!

Zerion Mini Shell 1.0