Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
encoder.cpython-314.pyc159 linesDownload Raw Back to __pycache__
1+
2��i^B��$�Rt^RIt^RIHt^RIHt^RIHt	]P!R4t]P!R4t]P!R4t
RR	R3RRR
RRRRRRRR/t]!^ 4F*t]P#]!]4RP']44K,	A]!R4tRt];'g]tRt];'g]t!RR]4t]]]]]]]] ]!]PD34Rlt#R# ]dRtL�i;i ]dRtL�i;i ]dRt	L�i;i)zImplementation of JSONEncoder5N)�encode_basestring_ascii)�encode_basestring)�make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[�-�]�\z\\�"z\"�z\b�z\f�6z\n�
z\r�	z\t�	\u{0:04x}�infc�N�RpR\PW4,R,#)z5Return a JSON representation of a Python string7 8    c�:�\VP^4,#)�)�9ESCAPE_DCT�group)�matchs&�Lib\json\encoder.py�replace�%py_encode_basestring.<locals>.replace)s���%�+�+�a�.�)�)�r)�ESCAPE�sub��srs& r�py_encode_basestringr%s ��*�����G�'�'�#�-�-rc�N�RpR\PW4,R,#)zAReturn an ASCII-only JSON representation of a Python string10 11    c�.�VP^4p\V,# \dj\T4pTR8dRP	T4u#TR,pRT^12,	R,,pRTR,,pRP	Y44u#i;i)riri�i�i�z\u{0:04x}\u{1:04x})rr�KeyError�ord�format)rr�n�s1�s2s&    rr�+py_encode_basestring_ascii.<locals>.replace5s����K�K��N��	=��a�=� ���13	=��A��A��7�{�#�*�*�1�-�-��W�����R��5�0�1���q�5�y�)��-�4�4�R�<�<�14	=�s� �.B�AB�Br)�ESCAPE_ASCIIrrs& r�py_encode_basestring_asciir'1s$��=���!�!�'�-�-��3�3rc�la�]tRt^JtoRtRtRtRRRRRRR	RR15RRRR
RRR/RltRtRt	RRlt16RtVtR#)�JSONEncodera�Extensible JSON <https://json.org> encoder for Python data structures.17 18Supports the following objects and types by default:19 20+-------------------+---------------+21| Python            | JSON          |22+===================+===============+23| dict              | object        |24+-------------------+---------------+25| list, tuple       | array         |26+-------------------+---------------+27| str               | string        |28+-------------------+---------------+29| int, float        | number        |30+-------------------+---------------+31| True              | true          |32+-------------------+---------------+33| False             | false         |34+-------------------+---------------+35| None              | null          |36+-------------------+---------------+37 38To extend this to recognize other objects, subclass and implement a39``.default()`` method with another method that returns a serializable40object for ``o`` if possible, otherwise it should call the superclass41implementation (to raise ``TypeError``).42 43z, z: �skipkeysF�ensure_asciiT�check_circular�	allow_nan�	sort_keys�indentN�44separators�defaultc��WnW nW0nW@nWPnW`nVeVwVnVnMVeRVnVe	W�nR#R#)aConstructor for JSONEncoder, with sensible defaults.45 46If skipkeys is false, then it is a TypeError to attempt47encoding of keys that are not str, int, float, bool or None.48If skipkeys is True, such items are simply skipped.49 50If ensure_ascii is true, the output is guaranteed to be str objects51with all incoming non-ASCII and non-printable characters escaped.52If ensure_ascii is false, the output can contain non-ASCII and53non-printable characters.54 55If check_circular is true, then lists, dicts, and custom encoded56objects will be checked for circular references during encoding to57prevent an infinite recursion (which would cause an RecursionError).58Otherwise, no such check takes place.59 60If allow_nan is true, then NaN, Infinity, and -Infinity will be61encoded as such.  This behavior is not JSON specification compliant,62but is consistent with most JavaScript based encoders and decoders.63Otherwise, it will be a ValueError to encode such floats.64 65If sort_keys is true, then the output of dictionaries will be66sorted by key; this is useful for regression tests to ensure67that JSON serializations can be compared on a day-to-day basis.68 69If indent is a non-negative integer, then JSON array70elements and object members will be pretty-printed with that71indent level.  An indent level of 0 will only insert newlines.72None is the most compact representation.73 74If specified, separators should be an (item_separator,75key_separator) tuple.  The default is (', ', ': ') if *indent* is76``None`` and (',', ': ') otherwise.  To get the most compact JSON77representation, you should specify (',', ':') to eliminate78whitespace.79 80If specified, default is a function that gets called for objects81that can't otherwise be serialized.  It should return a JSON82encodable version of the object or raise a ``TypeError``.83 84N�,)	r*r+r,r-r.r/�item_separator�
key_separatorr1)	�selfr*r+r,r-r.r/r0r1s	&$$$$$$$$r�__init__�JSONEncoder.__init__isY��Z!�
�(��,��"��"�����!�6@�3�D���!3�
�
�"%�D����"�L�rc�H�\RVPPR24h)a�Implement this method in a subclass such that it returns85a serializable object for ``o``, or calls the base implementation86(to raise a ``TypeError``).87 88For example, to support arbitrary iterators, you could89implement default like this::90 91    def default(self, o):92        try:93            iterable = iter(o)94        except TypeError:95            pass96        else:97            return list(iterable)98        # Let the base class default method raise the TypeError99        return super().default(o)100 101zObject of type z is not JSON serializable)�	TypeError�	__class__�__name__)r6�os&&rr1�JSONEncoder.default�s-��&�/�!�+�+�*>�*>�)?�@3�4�5�	5rc��\V\4'd)VP'd\V4#\	V4#VPVRR7p\V\\34'g\
V4pRPV4#)z�Return a JSON string representation of a Python data structure.102 103>>> from json.encoder import JSONEncoder104>>> JSONEncoder().encode({"foo": ["bar", "baz"]})105'{"foo": ["bar", "baz"]}'106 107T)�	_one_shot�)	�108isinstance�strr+rr�109iterencode�list�tuple�join)r6r=�chunkss&& r�encode�JSONEncoder.encode�so���a����� � � �.�q�1�1�(��+�+�����d��3���&�4��-�0�0��&�\�F��w�w�v��rc��VP'd/pMRpVP'd\pM\pVP\110P\\)3RlpVPe!\VP\4'dVPpMRVP,pV'dW\eO\W0PWFVPVPVPVP VP4	pMD\#W0PWFVVPVPVPVP V4111pV!V^4#)z�Encode the given object and yield each string112representation as available.113 114For example::115 116    for chunk in JSONEncoder().iterencode(bigobject):117        mysocket.write(chunk)118 119Nc��W8wdRpMW8XdRpMW8XdRpMV!V4#V'g\R\V4,4hV#)�NaN�Infinityz	-Infinityz2Out of range float values are not JSON compliant: )�120ValueError�repr)r=r-�_repr�_inf�_neginf�texts&&&&& r�floatstr�(JSONEncoder.iterencode.<locals>.floatstr�sQ���v�����!����"���Q�x��� �H���G�����Kr� )r,r+rrr-�float�__repr__�INFINITYr/rBrC�c_make_encoderr1r5r4r.r*�_make_iterencode)r6r=r@�markers�_encoderrUr/�_iterencodes&&&     rrD�JSONEncoder.iterencode�s�������G��G�����.�H�(�H�"&�.�.��n�n�8�h�Y�	�.�;�;��*�T�[�[�#�">�">��[�[�F��4�;�;�&�F���3�(����x��"�"�D�$7�$7�����
�
�t�~�~�/�K�121+����x���"�"�D�$7�$7�����
�
�y�*�K��1�a� � r)	r-r,r1r+r/r4r5r*r.)F)
r<�122__module__�__qualname__�__firstlineno__�__doc__r4r5r7r1rIrD�__static_attributes__�__classdictcell__)�
__classdict__s@rr)r)Jsn�����8�N��M�8#�5�8#�t�8#��8#�+/�8#�;@�8#��8#�$(�8#�26�8#�t5�,�,8!�8!rr)c��aaaaaaaaaa123aaa
aaaaaaaaa�V124VVVVVVVVVVV
VVVVVV3RloV125VVVVVVVVVVVVVV
VVVVVV3RloV126VVVVVVVVVV
VVVVVV3RloS#)c3��<"�V'gRx�R#SeS!V4pVS9d	S127!R4hVSV&RpS
e,V^,
pRS
V,,pSV,pW4,
pMRpSp\V4F�wrgV'dTpS!VS4'dVS!V4,x�K2VfVR,x�KCVRJdVR,x�KVVRJdVR	,x�KiS!VS4'dVS!V4,x�K�S!VS4'dVS!V4,x�K�Vx�S!VSS34'd128S!Wq4pM S!VS4'd129S!Wq4pMS!Wq4pTRjx�L130K�	VeV^,pRS
V,,x�Rx�SeSXR#R#L6 \dh\d1p	T	PR131\	T4P132RT24hRp	?	ii;i5i)
z[]N�Circular reference detected�[r	�nullT�trueF�false�when serializing � item �])�	enumerate�
GeneratorExit�
BaseException�add_note�typer<)�lst�_current_indent_level�markerid�buf�newline_indent�	separator�i�valuerH�excrOr^�	_floatstr�_indent�_intstr�_item_separatorr_�_iterencode_dict�_iterencode_list�dictrX�id�intrBrEr]rCrFs&&        ������������������rr��*_make_iterencode.<locals>._iterencode_lists�������J�����#�w�H��7�"� �!>�?�?� #�G�H������!�Q�&�!�!�G�.C�$C�C�N�'�.�8�I��!�C�!�N�'�I�!�#��H�A����
��e�S�)�)�����/�/��]���,�&��d�]���,�&��e�^���-�'���s�+�+�����.�.���u�-�-��	�%� 0�0�0��I�!�%�$���7�7�!1�%�!O��#�E�4�0�0�!1�%�!O��!,�U�!J��%�%�%�9'�D�%�!�Q�&�!���#8�8�8�8��	�����!��&�� �
�� �
����0��c��1C�1C�0D�F�1�#�N�O���
�s��A>G$�F�F�"G$�$F�3G$�5F�G$�F�G$�F�*F�;G$�=F�F�G$�F�4F�F�"F�#F�'2G$�F�G!�0G!�1+G�G!�!G$c3�<"�V'gRx�R#SeS!V4pVS9d	S!R4hVSV&Rx�Se$V^,
pRSV,,pSV,pMRpSpRpS'd\VP44pMVP4pVEFjwrxS!VS4'dMuS!VS4'd133S
!V4pM]VRJdRpMTVRJdRpMKVfR	pMDS!VS4'd134S!V4pM,S'dKi\R135VPP24hV'dRpVeVx�MVx�S!V4x�Sx�S!VS4'd
S!V4x�K�VfR	x�K�VRJdRx�K�VRJdRx�K�S!VS4'dS!V4x�EK136S!VS4'dS
!V4x�EK&S!VSS34'd137S!W�4p	M S!VS4'd138S!W�4p	MS!W�4p	T	Rjx�L139EKm	V'g VeV^,pRSV,,x�R
x�SeSXR#R#L? \140dh\d2p141T142PR\T4PRT:24hRp143?144ii;i5i)z{}Nrj�{r	TrmFrnrlz0keys must be str, int, float, bool or None, not rorp�})	�sorted�itemsr:r;r<rsrtrurv) �dctrxryr{r4�firstr��keyr~rHrrOr^r�r�r�r�r_r�r��_key_separator�	_skipkeys�145_sort_keysr�rXr�r�rBrEr]rCrFs &&         ���������������������rr��*_make_iterencode.<locals>._iterencode_dictSs�������J�����#�w�H��7�"� �!>�?�?� #�G�H���	���!�Q�&�!�!�G�.C�$C�C�N�,�~�=�N�!�N�,�N�����3�9�9�;�'�E��I�I�K�E��J�C��#�s�#�#���C��'�'���n�����������������C��%�%��c�l�����#'�'*�}�}�'=�'=�&>�!@�A�A����!�-�(�(��$�$��3�-�� � �
��e�S�)�)�"�5�/�)��]� �L��d�]� �L��e�^�!�M���s�+�+�!�%�.�(���u�-�-�#�E�*�*�!�%�$���7�7�!1�%�!O��#�E�4�0�0�!1�%�!O��!,�U�!J��%�%�%�i �t��3�!�Q�&�!���#8�8�8�8��	�����!��&�� �
�� �
����0��c��1C�1C�0D�F�3�'�R�S���
�s��A'J�+AJ�<0J�-J�>+J�*J�H>�146H>�!J�#H>�+J�-147H>�7J�9148H>�J�H>�149H>�J�!H>�0150H>�:J�=H>�H>�&H>�<H<�=H>�J�.J�<H>�>J�J�,J�J�Jc3�<"�S!VS4'd
S!V4x�R#VfRx�R#VRJdRx�R#VRJdRx�R#S!VS4'd
S	!V4x�R#S!VS4'd
S!V4x�R#S!VSS34'dS!W4Rjx�L151R#S!VS
4'dS!W4Rjx�L152R#SeS!V4pVS9d	S!R4hVSV&S!V4pS153!W14Rjx�L154SeSXR#R#LkLLL \dh\d/pTPR\T4PR24hRp?ii;i5i)	NrlTrmFrnrjroz object)rsrtrurvr<)r=rxry�newobjrrO�_defaultr^r�r�r_r�r�r�rXr�r�rBrEr]rCrFs&&   �����������������rr_�%_make_iterencode.<locals>._iterencode�sR�����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�[�F�
�&�v�E�E�E��"��H�%�#�#
B�A�F�� �
�� �
����0��a��1A�1A�0B�'�J�K���
�sx�AE�E�+E�E�C?�E�)E�4D�5.E�$D�/D�0D�4E�E�D�E	�E	�)E�E	�	E�)r]r�r^r�r�r�r�r�r�r@rOr�rXr�r�rBrErCrFr�r_r�r�sfffffffff&ffffffffff@@@rr\r\	sF�����9"�9"�9"�vU"�U"�U"�U"�n"&�"&�"&�F�r)$rd�re�_jsonr�c_encode_basestring_ascii�ImportErrorr�c_encode_basestringrr[�compilerr&�HAS_UTF8r�ranger}�155setdefault�chrr!rXrZrr'�objectr)rOr�r�r�rBrErCrFrYr\r�rr�<module>r�sd���	�%�J��>��4�156���/�	0���z�z�,�-��
�:�:�n�%���&����%��%��%��%��%��157�158�t��A����#�a�&�,�"5�"5�a�"8�9�159����<��.�)�@�@�,@��4�.�;�;�!;��}!�&�}!�D�
��
���
������D��E�%� $��%�����������N��s3�C%�C4�D�%	C1�0C1�4	D�?D�	D�D