Your IP : 3.139.86.58


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/simplejson/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/simplejson/__pycache__/decoder.cpython-311.pyc

�

\�Dg;�	�
�dZddlmZddlZddlZddlZddlmZmZddl	m
Z
mZd�Ze��Z
dgZejejzejzZd	�Ze��\ZZZeeed
�Zejde��Zdd
ddddddd�ZdZeed��reZnd#d�Zejd��jfd�Z ddeejdj!eej"e fd�Z#e
pe#Z$ejde��Z%dZ&de%je&fd �Z'e%je&fd!�Z(Gd"�de)��Z*dS)$zImplementation of JSONDecoder
�)�absolute_importN�)�PY3�unichr)�make_scanner�JSONDecodeErrorc�6�	ddlm}|S#t$rYdSwxYw)Nr��
scanstring)�	_speedupsr�ImportErrorr
s �t/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/simplejson/decoder.py�_import_c_scanstringr
sA���)�)�)�)�)�)���������t�t����s�
�
��JSONDecoderc���tjdkr.d�d��}tjd|��\}}ntd��}td��}|||fS)N)��� 7FF80000000000007FF0000000000000�hexz>dd�nan�inf)�sys�version_info�decode�struct�unpack�float)�_BYTESrrs   r�_floatconstantsrs^��
��&� � �3�:�:�5�A�A���=���/�/���S�S��E�l�l���E�l�l����c�T�>��)z	-Infinity�Infinity�NaNz(.*?)(["\\\x00-\x1f])�"�\�/���
�
�	)r#r$r%�b�f�n�r�tzutf-8�get_int_max_str_digits��c��t|��|kr#td|�dt|���d����t|��S)z�Backport of the integer string length conversion limitation

        https://docs.python.org/3/library/stdtypes.html#int-max-str-digits
        zExceeds the limit (z+) for integer string conversion: value has z digits)�len�
ValueError�int)�s�INT_MAX_STR_DIGITSs  r�bounded_intr84sq��
�q�6�6�&�&�&��*�l~�l~�l~�AD�EF�AG�AG�AG�AG�H�I�I�
I��1�v�v�
r z^[0-9a-fA-F]{4}$c���d}|||dz�}||��st|||dz
���	t|d��|dzfS#t$rt|||dz
���wxYw)z5Scan a four digit hex number from s[end:end + 4]
    zInvalid \uXXXX escape sequence�r�)rr5r4)r6�end�_m�msg�escs     r�scan_four_digit_hexr@>s���,�C�
�C��a��K�.�C�
�2�c�7�7�/��c�1�c�A�g�.�.�.�/��3��|�|�S�1�W�$�$���/�/�/��c�1�c�A�g�.�.�.�/���s�A�A$T�c
�b�|�t}g}
|
j}|dz
}	|||��}
|
�td||���|}|
���}|
���\}}|r2|s%t|t��st
||��}||��|dkr�n|dkr!|rd}t|||���||����	||}n#t$rtd||���wxYw|dkr1	||}n!#t$rd}t|||���wxYw|dz
}no|	||dz��\}}|d	krH|d
zdkr?|||dz�d
kr.|	||dz��\}}|d
zdkrd|dz
dz|dz
zz}|}t|��}||�����||
��|fS)a�Scan the string s for a JSON string. End is the index of the
    character in s after the quote that started the JSON string.
    Unescapes all valid JSON string escape sequences and raises ValueError
    on attempt to decode an invalid string. If strict is False then literal
    control characters are allowed in the string.

    Returns a tuple of the decoded string and the index of the character in s
    after the end quote.NrzUnterminated string starting atr#r$zInvalid control character %r at�uzInvalid \X escape sequence %ri��i�i�rz\ui�i�
)
�DEFAULT_ENCODING�appendrr<�groups�
isinstance�unicode�
IndexError�KeyErrorr)r6r<�encoding�strict�_br=�_join�_PY3�_maxunicode�_scan_four_digit_hex�chunks�_append�begin�chunk�prev_end�content�
terminatorr>r?�char�uni�uni2�end2s                       r�
py_scanstringr^Jsw����#��
�F��m�G��!�G�E�5���1�c�
�
���=�!�1�1�e�=�=�
=����i�i�k�k��#�l�l�n�n�����	��
5�
�7�G� <� <�
5�!�'�8�4�4���G�G���������
�4�
�
��
�7��%�c�1�h�7�7�7���
�#�#�#��	=��C�&�C�C���	=�	=�	=�!�1�1�e�=�=�
=�	=�����#�:�:�
3��#�w�����
3�
3�
3�6��%�c�1�c�2�2�2�
3����
�1�H�C�C�,�+�A�s�Q�w�7�7�H�C���e�#�#��f���&�&��#�c�A�g�+��%�'�'�1�1�!�S�1�W�=�=�
��d��&�=�F�*�*�!�s�V�|��&:�)-���&8�9�C��C��#�;�;�D����
�
�
�k5�l�5��=�=�#��s�	C�C.�8D�Dz
[ \t\n\r]*z 	

c	�L�|\}	}
|�i}|j}g}|	|
|
dz�}
|
dkrv|
|vr+||	|
�����}
|	|
|
dz�}
|
dkr*|�||��}||
dzfSi}|�||��}||
dzfS|
dkrtd|	|
���|
dz
}
	t|	|
||��\}}
|||��}|	|
|
dz�dkr@||	|
�����}
|	|
|
dz�dkrtd|	|
���|
dz
}
	|	|
|vr0|
dz
}
|	|
|vr!||	|
dz�����}
n#t$rYnwxYw||	|
��\}}
|�||f��	|	|
}
|
|vr)||	|
dz�����}
|	|
}
n#t$rd}
YnwxYw|
dz
}
|
dkrn�|
d	krtd
|	|
dz
���	|	|
}
|
|vr:|
dz
}
|	|
}
|
|vr)||	|
dz�����}
|	|
}
n#t$rd}
YnwxYw|
dz
}
|
dkrtd|	|
dz
������|�||��}||
fSt
|��}|�||��}||
fS)Nrr#�}z8Expecting property name enclosed in double quotes or '}'T�:zExpecting ':' delimiterrA�,zExpecting ',' delimiter or '}'z1Expecting property name enclosed in double quotes)�
setdefaultr<rrrJrF�dict)�staterLrM�	scan_once�object_hook�object_pairs_hook�memo�_w�_wsr6r<�memo_get�pairs�nextchar�result�key�values                 r�
JSONObjectrr�s����H�Q���|�����H��E���S�1�W��~�H��3����s�?�?��"�Q��*�*�.�.�"�"�C���S�1�W��~�H��s�?�?� �,�*�*�5�1�1���s�Q�w��&��E��&�#��E�*�*���#��'�>�!�
��_�_�!�J��3���
��1�H�C�5��a��h��7�7���S��h�s�C� � ��
�S��q��[�>�S� � ��"�Q��*�*�.�.�"�"�C���S�1�W��~��$�$�%�&?��C�H�H�H��q���	���v��}�}��q����S�6�S�=�=��"�Q��a��.�.�,�,�.�.�C����	�	�	��D�	�����Y�q�#�&�&�
��s�
���c�5�\�"�"�"�	���v�H��3����b��C�!�G�n�n�(�(�*�*���S�6�����	�	�	��H�H�H�	�����q����s�?�?��
��_�_�!�"B�A�s�Q�w�O�O�O�		���v�H��3����q����S�6���s�?�?��"�Q��a��.�.�,�,�.�.�C� ��v�H����	�	�	��H�H�H�	����	�q����s�?�?�!�C��3��7���
�g5�n�$�"�"�5�)�)���s�{����K�K�E�����E�"�"���#�:�s7�:E�
E"�!E"�5G�G�G�;AI�I�Ic��|\}}g}|||dz�}||vr.|||dz�����}|||dz�}|dkr||dzfS|dkrtd||���|j}	|||��\}	}||	��|||dz�}||vr.|||dz�����}|||dz�}|dz
}|dkrng|dkrtd||dz
���	|||vr0|dz
}|||vr!|||dz�����}n#t$rYnwxYw��||fS)Nr�]rAzExpecting value or ']'TrbzExpecting ',' delimiter or ']')r<rrFrJ)
rerfrjrkr6r<�valuesrnrTrqs
          r�	JSONArrayrv�s����H�Q��
�F���S�1�W��~�H��3����b��C�!�G�n�n� � �"�"���S��q��[�>���3����s�Q�w���	�R����6��3�?�?�?��m�G���Y�q�#�&�&�
��s��������S��q��[�>���s�?�?��"�Q��a��.�.�$�$�&�&�C���S�1�W��~�H��q����s�?�?��
��_�_�!�"B�A�s�Q�w�O�O�O�	���v��}�}��q����S�6�S�=�=��"�Q��a��.�.�,�,�.�.�C����	�	�	��D�	����%�*�3�;�s�3:D.�.
D;�:D;c�N�eZdZdZ			d	d�Zejefd�Zdejefd�Z	dS)
ra3Simple JSON <http://json.org> decoder

    Performs the following translations in decoding by default:

    +---------------+-------------------+
    | JSON          | Python            |
    +===============+===================+
    | object        | dict              |
    +---------------+-------------------+
    | array         | list              |
    +---------------+-------------------+
    | string        | str, unicode      |
    +---------------+-------------------+
    | number (int)  | int, long         |
    +---------------+-------------------+
    | number (real) | float             |
    +---------------+-------------------+
    | true          | True              |
    +---------------+-------------------+
    | false         | False             |
    +---------------+-------------------+
    | null          | None              |
    +---------------+-------------------+

    When allow_nan=True, it also understands
    ``NaN``, ``Infinity``, and ``-Infinity`` as
    their corresponding ``float`` values, which is outside the JSON spec.

    NTFc	�4�|�t}||_||_||_|pt|_|pt|_|p|rtj	pd|_
||_t|_
t|_t |_i|_t'|��|_dS)a�	
        *encoding* determines the encoding used to interpret any
        :class:`str` objects decoded by this instance (``'utf-8'`` by
        default).  It has no effect when decoding :class:`unicode` objects.

        Note that currently only encodings that are a superset of ASCII work,
        strings of other encodings should be passed in as :class:`unicode`.

        *object_hook*, if specified, will be called with the result of every
        JSON object decoded and its return value will be used in place of the
        given :class:`dict`.  This can be used to provide custom
        deserializations (e.g. to support JSON-RPC class hinting).

        *object_pairs_hook* is an optional function that will be called with
        the result of any object literal decode with an ordered list of pairs.
        The return value of *object_pairs_hook* will be used instead of the
        :class:`dict`.  This feature can be used to implement custom decoders
        that rely on the order that the key and value pairs are decoded (for
        example, :func:`collections.OrderedDict` will remember the order of
        insertion). If *object_hook* is also defined, the *object_pairs_hook*
        takes priority.

        *parse_float*, if specified, will be called with the string of every
        JSON float to be decoded.  By default, this is equivalent to
        ``float(num_str)``. This can be used to use another datatype or parser
        for JSON floats (e.g. :class:`decimal.Decimal`).

        *parse_int*, if specified, will be called with the string of every
        JSON int to be decoded.  By default, this is equivalent to
        ``int(num_str)``.  This can be used to use another datatype or parser
        for JSON integers (e.g. :class:`float`).

        *allow_nan*, if True (default false), will allow the parser to
        accept the non-standard floats ``NaN``, ``Infinity``, and ``-Infinity``.

        *parse_constant*, if specified, will be
        called with one of the following strings: ``'-Infinity'``,
        ``'Infinity'``, ``'NaN'``. It is not recommended to use this feature,
        as it is rare to parse non-compliant JSON containing these values.

        *strict* controls the parser's behavior when it encounters an
        invalid control character in a string. The default setting of
        ``True`` means that unescaped control characters are parse errors, if
        ``False`` then control characters will be allowed in strings.

        N)rErLrgrhr�parse_floatr8�	parse_int�
_CONSTANTS�__getitem__�parse_constantrMrr�parse_objectrv�parse_arrayr�parse_stringrirrf)	�selfrLrgryrzr}rMrh�	allow_nans	         r�__init__zJSONDecoder.__init__;s���b��'�H� ��
�&���!2���&�/�%���"�1�k���,�^��1U�z�?U�1]�Y]������&���$���&�����	�%�d�+�+����r c�.�|r*t|t��rt||j��}|�|��\}}|||�����}|t
|��krtd||t
|�����|S)zzReturn the Python representation of ``s`` (a ``str`` or ``unicode``
        instance containing a JSON document)

        z
Extra data)rH�bytes�strrL�
raw_decoder<r3r)r�r6rjrP�objr<s      rrzJSONDecoder.decode{s���
�	&�J�q�%�(�(�	&��A�t�}�%�%�A��?�?�1�%�%���S��b��C�j�j�n�n�����#�a�&�&�=�=�!�,��3��A���?�?�?��
r rc��|dkrtd||���|r$t|t��std���t	|��|kr=t||��}|dkr|dz
}n|dkr|||dz�dkr|dz
}|�||||������	��S)
a�Decode a JSON document from ``s`` (a ``str`` or ``unicode``
        beginning with a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.
        Optionally, ``idx`` can be used to specify an offset in ``s`` where
        the JSON document begins.

        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.

        rzExpecting valuez$Input string must be text, not bytesi��r���u)�idx)rrHr��	TypeErrorr3�ordrfr<)r�r6r�rjrP�ord0s      rr�zJSONDecoder.raw_decode�s�����7�7�"�"3�Q��<�<�<��	D�
�1�c�*�*�	D��B�C�C�C��q�6�6�C�<�<��q��v�;�;�D��v�~�~��q��������!�C��a��K�.�N�"B�"B��q����~�~�a�R�R��3�Z�Z�^�^�%5�%5�~�6�6�6r )NNNNNTNF)
�__name__�
__module__�__qualname__�__doc__r��
WHITESPACE�matchrrr��r rrrs~��������<EI�8<�.3�>,�>,�>,�>,�@&�+�#�����!"�j�&6�S�7�7�7�7�7�7r )r1)+r��
__future__r�rerr�compatrr�scannerrrr�c_scanstring�__all__�VERBOSE�	MULTILINE�DOTALL�FLAGSrr"�PosInf�NegInfr{�compile�STRINGCHUNK�	BACKSLASHrE�hasattrr5r8r�r@�join�
maxunicoder^rr��WHITESPACE_STRrrrv�objectrr�r r�<module>r�sW����&�&�&�&�&�&�	�	�	�	�
�
�
�
�
�
�
�
���������2�2�2�2�2�2�2�2����$�#�%�%���/��
�
�R�\�!�B�I�-�����&�o�'�'���V�V������
��b�j�1�5�9�9��	
�U��	�U��U��
�
�	�
��
�7�3�(�)�)�
��K�K�����$.�2�:�.A�#B�#B�#H�
/�
/�
/�
/�$(����*�#�(�
�c�n�0�G�G�G�G�V�
*�]�
�
�R�Z�
�u�
-�
-�
���!%����\�\�\�\�|$.�#3��"�"�"�"�HD7�D7�D7�D7�D7�&�D7�D7�D7�D7�D7r 

?>