%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/json/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/json/__pycache__/encoder.cpython-312.pyc

�

���f�>�
���dZddlZ	ddlmZ	ddlmZ	ddlmZ	ejd�Zejd�Zejd�Z
d	d
ddd
ddd�Zed�D])Zej#ee�dj'e���+[ed�Zd�ZexseZd�ZexseZGd�de�Zeeeeeeee e!ejDf
d�Z#y#e$rdZY��wxYw#e$rdZY��wxYw#e$rdZ	Y��wxYw)zImplementation of JSONEncoder
�N)�encode_basestring_ascii)�encode_basestring)�make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[�-�]z\\z\"z\bz\fz\nz\rz\t)�\�"���
�
�	� �	\u{0:04x}�infc�@�d�}dtj||�zdzS)z5Return a JSON representation of a Python string

    c�2�t|jd�S)Nr)�
ESCAPE_DCT�group)�matchs �#/usr/lib/python3.12/json/encoder.py�replacez%py_encode_basestring.<locals>.replace)s���%�+�+�a�.�)�)�r)�ESCAPE�sub��srs  r�py_encode_basestringr%s"��*�����G�Q�'�'�#�-�-rc�@�d�}dtj||�zdzS)zAReturn an ASCII-only JSON representation of a Python string

    c���|jd�}	t|S#t$rPt|�}|dkrdj	|�cYS|dz}d|dz	dzz}d|dzz}dj	||�cYSwxYw)	Nriri��
i�i�z\u{0:04x}\u{1:04x})rr�KeyError�ord�format)rr�n�s1�s2s     rrz+py_encode_basestring_ascii.<locals>.replace5s����K�K��N��	=��a�=� ���
	=��A��A��7�{�#�*�*�1�-�-��W�����R��5�0�1���q�5�y�)��-�4�4�R��<�<�
	=�s��*A5�*A5�4A5r)�ESCAPE_ASCIIrrs  r�py_encode_basestring_asciir'1s&��=���!�!�'�1�-�-��3�3rc	�F�eZdZdZdZdZddddddddd�d�Zd	�Zd
�Zdd�Z	y)
�JSONEncodera[Extensible JSON <https://json.org> encoder for Python data structures.

    Supports the following objects and types by default:

    +-------------------+---------------+
    | Python            | JSON          |
    +===================+===============+
    | dict              | object        |
    +-------------------+---------------+
    | list, tuple       | array         |
    +-------------------+---------------+
    | str               | string        |
    +-------------------+---------------+
    | int, float        | number        |
    +-------------------+---------------+
    | True              | true          |
    +-------------------+---------------+
    | False             | false         |
    +-------------------+---------------+
    | None              | null          |
    +-------------------+---------------+

    To extend this to recognize other objects, subclass and implement a
    ``.default()`` method with another method that returns a serializable
    object for ``o`` if possible, otherwise it should call the superclass
    implementation (to raise ``TypeError``).

    z, z: FTN)�skipkeys�ensure_ascii�check_circular�	allow_nan�	sort_keys�indent�
separators�defaultc��||_||_||_||_||_||_|�|\|_|_n	|�d|_|�||_yy)a�Constructor for JSONEncoder, with sensible defaults.

        If skipkeys is false, then it is a TypeError to attempt
        encoding of keys that are not str, int, float or None.  If
        skipkeys is True, such items are simply skipped.

        If ensure_ascii is true, the output is guaranteed to be str
        objects with all incoming non-ASCII characters escaped.  If
        ensure_ascii is false, the output can contain non-ASCII characters.

        If check_circular is true, then lists, dicts, and custom encoded
        objects will be checked for circular references during encoding to
        prevent an infinite recursion (which would cause an RecursionError).
        Otherwise, no such check takes place.

        If allow_nan is true, then NaN, Infinity, and -Infinity will be
        encoded as such.  This behavior is not JSON specification compliant,
        but is consistent with most JavaScript based encoders and decoders.
        Otherwise, it will be a ValueError to encode such floats.

        If sort_keys is true, then the output of dictionaries will be
        sorted by key; this is useful for regression tests to ensure
        that JSON serializations can be compared on a day-to-day basis.

        If indent is a non-negative integer, then JSON array
        elements and object members will be pretty-printed with that
        indent level.  An indent level of 0 will only insert newlines.
        None is the most compact representation.

        If specified, separators should be an (item_separator, key_separator)
        tuple.  The default is (', ', ': ') if *indent* is ``None`` and
        (',', ': ') otherwise.  To get the most compact JSON representation,
        you should specify (',', ':') to eliminate whitespace.

        If specified, default is a function that gets called for objects
        that can't otherwise be serialized.  It should return a JSON encodable
        version of the object or raise a ``TypeError``.

        N�,)	r*r+r,r-r.r/�item_separator�
key_separatorr1)	�selfr*r+r,r-r.r/r0r1s	         r�__init__zJSONEncoder.__init__isg��V!��
�(���,���"���"�������!�6@�3�D���!3�
�
�"%�D����"�D�L�rc�H�td|jj�d���)abImplement this method in a subclass such that it returns
        a serializable object for ``o``, or calls the base implementation
        (to raise a ``TypeError``).

        For example, to support arbitrary iterators, you could
        implement default like this::

            def default(self, o):
                try:
                    iterable = iter(o)
                except TypeError:
                    pass
                else:
                    return list(iterable)
                # Let the base class default method raise the TypeError
                return super().default(o)

        zObject of type z is not JSON serializable)�	TypeError�	__class__�__name__)r6�os  rr1zJSONEncoder.default�s-��&�/�!�+�+�*>�*>�)?�@3�4�5�	5rc���t|t�r"|jrt|�St	|�S|j|d��}t|ttf�st
|�}dj|�S)z�Return a JSON string representation of a Python data structure.

        >>> from json.encoder import JSONEncoder
        >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
        '{"foo": ["bar", "baz"]}'

        T)�	_one_shot�)	�
isinstance�strr+rr�
iterencode�list�tuple�join)r6r<�chunkss   r�encodezJSONEncoder.encode�sf���a���� � �.�q�1�1�(��+�+�����d��3���&�4��-�0��&�\�F��w�w�v��rc�6�|jri}nd}|jrt}nt}|jt
jttfd�}|rlt�f|j�Zt||j||j|j|j|j|j|j�	}nPt||j||j||j|j|j|j|�
}||d�S)z�Encode the given object and yield each string
        representation as available.

        For example::

            for chunk in JSONEncoder().iterencode(bigobject):
                mysocket.write(chunk)

        Nc�x�||k7rd}n||k(rd}n||k(rd}n||�S|stdt|�z��|S)N�NaN�Infinityz	-Infinityz2Out of range float values are not JSON compliant: )�
ValueError�repr)r<r-�_repr�_inf�_neginf�texts      r�floatstrz(JSONEncoder.iterencode.<locals>.floatstr�sW���A�v����d��!���g��"���Q�x��� �H���G�����Krr)r,r+rrr-�float�__repr__�INFINITY�c_make_encoderr/r1r5r4r.r*�_make_iterencode)r6r<r>�markers�_encoderrR�_iterencodes       rrBzJSONEncoder.iterencode�s�������G��G����.�H�(�H�"&�.�.��n�n�8�h�Y�	�.
�.�4��K�K�'�(�����x�����"�"�D�$7�$7�����
�
�t�~�~�/�K�
+�����x����h��"�"�D�$7�$7�����
�
�y�*�K��1�a� � r)F)
r;�
__module__�__qualname__�__doc__r4r5r7r1rGrB�rrr)r)Js;���8�N��M�#(�t��4�5��D�$�6#�p5�,�,5!rr)c������������
���
����������������sd�z��
�����������
������fd���
��������������
������fd���
����������
������fd���S)N� c3�8�K�|sd��y���|�}|�vr�	d��|�|<d}��|dz
}d�|zz}�|z}||z
}nd}�}d}|D]�}|rd}n|}�|��r|�
|�z���!|�|dz���+|dur|d	z���7|dur|d
z���C�|��r|�
|�z���Z�|��r|�|�z���q|���|��f�r
�||�}n�|��r
�||�}n	�||�}|Ed{�����|�|dz}d�|zz��d�����=yy7�"�w)Nz[]�Circular reference detected�[�r
TF�null�true�false�]r^)�lst�_current_indent_level�markerid�buf�newline_indent�	separator�first�valuerFrLrY�	_floatstr�_indent�_intstr�_item_separatorrZ�_iterencode_dict�_iterencode_list�dictrS�id�intr@rCrXrArDs         ������������������rrvz*_make_iterencode.<locals>._iterencode_lists��������J�����#�w�H��7�"� �!>�?�?� #�G�H������!�Q�&�!�!�G�.C�$C�C�N�'�.�8�I��>�!�C�!�N�'�I����	"�E�������%��%��H�U�O�+�+����F�l�"��$���F�l�"��%���G�m�#��E�3�'��G�E�N�*�*��E�5�)��I�e�,�,�,��	��e�d�E�]�3�-�e�5J�K�F���t�,�-�e�5J�K�F�(��0E�F�F�!�!�!�;	"�<�%�!�Q�&�!���#8�8�8�8��	�����!��"�s�C2D�5D�6#Dc3�\�K�|sd��y���|�}|�vr�
d��|�|<d���
�|dz
}d�
|zz}�|z}|��nd}�}d}�rt|j��}n|j�}|D�]\}}�|��rn\�|��r	�|�}nJ|durd}nC|durd	}n<|�d
}n7�|��r	�|�}n%�r�Ktd|jj����|rd}n|���|�������|��r�|�����|�d
����|durd����|durd	�����|��r�|������|��r�|������|��f�r
�||�}	n�|��r
�||�}	n	�||�}	|	Ed{�����|�|dz}d�
|zz��d�����=yy7�#�w)
Nz{}rb�{rdr
TrfFrgrez0keys must be str, int, float, bool or None, not �})�sorted�itemsr9r:r;)�dctrjrkrmr4ror~�keyrprFrLrYrqrrrsrtrZrurv�_key_separator�	_skipkeys�
_sort_keysrwrSrxryr@rCrXrArDs          ���������������������rruz*_make_iterencode.<locals>._iterencode_dictNsD�������J�����#�w�H��7�"� �!>�?�?� #�G�H���	���!�Q�&�!�!�G�.C�$C�C�N�,�~�=�N� � �!�N�,�N�����3�9�9�;�'�E��I�I�K�E��1	"�J�C���#�s�#���C��'���n�����������������C��%��c�l�����#'�'*�}�}�'=�'=�&>�!@�A�A����$�$��3�-�� � ��%��%��u�o�%������$�����%���
��E�3�'��e�n�$��E�5�)���&�&��e�d�E�]�3�-�e�5J�K�F���t�,�-�e�5J�K�F�(��0E�F�F�!�!�!�c1	"�d�%�!�Q�&�!���#8�8�8�8��	�����!��"�s�FF,�F*�$F,c3��K��|��r�|���y|�d��y|durd��y|durd��y�|��r�|���y�|��r�|���y�|��f�r�
||�Ed{���y�|��r�	||�Ed{���y���
|�}|�vr�d��|�|<�|�}�||�Ed{������=yy7�[7�B7��w)NreTrfFrgrbr^)r<rjrkrL�_defaultrYrqrsrZrurvrwrSrxryr@rCrXrArDs   �����������������rrZz%_make_iterencode.<locals>._iterencode�s	������a����1�+��
�Y��L�
�$�Y��L�
�%�Z��M�
��3�
��!�*��
��5�
!��A�,��
��D�%�=�
)�'��+@�A�A�A�
��4�
 �'��+@�A�A�A��"��a�5���w�&�$�%B�C�C�$%���!����A�"�1�&;�<�<�<��"��H�%�#�
B��A��
=�s6�A-C�0C�1C�C�4C�C�C�C�Cr^)rXr�rYrrrqr�rtr�r�r>rLrwrSrxryr@rCrArDrsrZrurvs````````` ``````````@@@rrWrWs_�������:�g�s�#;���-��6"�6"�6"�pN"�N"�N"�N"�`&�&�&�:�r)$r]�re�_jsonr�c_encode_basestring_ascii�ImportErrorr�c_encode_basestringrrV�compilerr&�HAS_UTF8r�range�i�
setdefault�chrr"rSrUrr'�objectr)rLrwrxryr@rCrArDrTrWr^rr�<module>r�s[���	�%�J��>��4�
����/�	0���r�z�z�,�-���2�:�:�n�%��
�	�
�
�
�
�
��
�
�t��:�A����#�a�&�,�"5�"5�a�"8�9�:����<��.�)�@�,@��4�.�;�!;��x!�&�x!�z�
��
���
������w��{�%� $��%�����������N��s3�C�C�C)�C�C�C&�%C&�)C3�2C3

Zerion Mini Shell 1.0