%PDF- %PDF-
Mini Shell

Mini Shell

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

�

���f^^����dZddlZddlZddlZddlZddlZ	ddl
mZgd�Z
ddddd�d�Zddddd�d	�Zdd
�d�Zd�Zd
�Zd�ZGd�d�Zd�ZGd�d�Zeeeeeeeed�h�Zd�Z d�Z!y)a/Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes
-------

PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.

Functions
---------

pformat()
    Format a Python object into a pretty-printed representation.

pprint()
    Pretty-print a Python object to a stream [default is sys.stdout].

saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.

�N)�StringIO)�pprint�pformat�
isreadable�isrecursive�saferepr�
PrettyPrinter�ppFT��compact�
sort_dicts�underscore_numbersc	�J�t|||||||��}|j|�y)zAPretty-print a Python object to a stream [default is sys.stdout].)�stream�indent�width�depthrr
rN)r	r)	�objectrrrrrr
r�printers	         �/usr/lib/python3.12/pprint.pyrr0s-����f�E���J�-�/�G��N�N�6��c�B�t||||||��j|�S)z<Format a Python object into a pretty-printed representation.)rrrrr
r)r	r)rrrrrr
rs       rrr9s*����e�5�!(�Z�,>�@�@G����Pr)r
c�&�t|g|��d|i|��y)zPretty-print a Python objectr
N)r)rr
�args�kwargss    rr
r
@s��
�6�:�D�:�Z�:�6�:rc�@�t�j|idd�dS)z=Version of repr() which can handle recursive data structures.Nr�r	�
_safe_repr�rs rrrD� ���?�%�%�f�b�$��:�1�=�=rc�@�t�j|idd�dS)z4Determine if saferepr(object) is readable by eval().Nr�rrs rrrHr rc�@�t�j|idd�dS)z8Determine if object requires a recursive representation.Nr�rrs rrrLr rc�"�eZdZdZdgZd�Zd�Zy)�	_safe_keyaUHelper function for key functions when sorting unorderable objects.

    The wrapped-object will fallback to a Py2.x style comparison for
    unorderable types (sorting first comparing the type name and then by
    the obj ids).  Does not work recursively, so dict.items() must have
    _safe_key applied to both the key and the value.

    �objc��||_y�N)r')�selfr's  r�__init__z_safe_key.__init__\s	����rc�"�	|j|jkS#t$rjtt|j��t	|j�ftt|j��t	|j�fkcYSwxYwr))r'�	TypeError�str�type�id)r*�others  r�__lt__z_safe_key.__lt___sm��	;��8�8�e�i�i�'�'���	;���d�h�h��(�"�T�X�X�,�7���e�i�i��)�2�e�i�i�=�9�:�
;�	;�s��A0B�
BN)�__name__�
__module__�__qualname__�__doc__�	__slots__r+r2�rrr&r&Ps�����I��;rr&c�:�t|d�t|d�fS)z&Helper function for comparing 2-tuplesrr")r&)�ts r�_safe_tupler;fs���Q�q�T�?�I�a��d�O�+�+rc��eZdZd#dddd�d�Zd�Zd�Zd�Zd	�Zd
�Zd�Z	iZ
d�Zee
ej<d
�Zee
ej j<d�Zee
ej<d�Zee
ej<d�Zee
ej<ee
ej<d�Zee
ej<d�Zee
ej<d�Zee
ej<d�Zee
ej@j<d�Z!e!e
ejDj<d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(e(e
ejRj<d�Z*e*e
ejVj<d�Z,e,e
ejZj<d�Z.e.e
ej^j<d�Z0e0e
ejbj<d �Z2e2e
ejfj<d!�Z4e4e
ejjj<d"�Z6y)$r	NFTrc�2�t|�}t|�}|dkrtd��|�|dkrtd��|std��||_||_||_|�||_ntj|_t|�|_	||_
||_y)a�Handle pretty printing operations onto a stream using a set of
        configured parameters.

        indent
            Number of spaces to indent for each level of nesting.

        width
            Attempted maximum number of columns in the output.

        depth
            The maximum depth to print out nested structures.

        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.

        compact
            If true, several items will be combined in one line.

        sort_dicts
            If true, dict keys are sorted.

        underscore_numbers
            If true, digit groups are separated with underscores.

        rzindent must be >= 0Nzdepth must be > 0zwidth must be != 0)�int�
ValueError�_depth�_indent_per_level�_width�_stream�_sys�stdout�bool�_compact�_sort_dicts�_underscore_numbers)r*rrrrrr
rs        rr+zPrettyPrinter.__init__ks���8�V����E�
���A�:��2�3�3����!���0�1�1���1�2�2����!'��������!�D�L��;�;�D�L��W�
��
�%���#5�� rc��|j�<|j||jddid�|jjd�yy)Nr�
)rC�_format�write�r*rs  rrzPrettyPrinter.pprint�s=���<�<�#��L�L�����q�!�R��;��L�L���t�$�$rc�b�t�}|j||ddid�|j�S�Nr)�	_StringIOrL�getvalue)r*r�sios   rrzPrettyPrinter.pformat�s+���k�����V�S�!�Q��A�.��|�|�~�rc�0�|j|idd�dS)Nrr$��formatrNs  rrzPrettyPrinter.isrecursive�s���{�{�6�2�q�!�,�Q�/�/rc�@�|j|idd�\}}}|xr|SrPrU)r*r�s�readable�	recursives     rrzPrettyPrinter.isreadable�s*��!%���V�R��A�!>���8�Y��)�	�M�)rc
��t|�}||vr)|jt|��d|_d|_y|j|||�}|j|z
|z
}	t|�|	kDr�|jjt|�jd�}
|
�d||<|
|||||||dz�||=ytj|�r�t|t�sp|jj rZt#|jd�rDd|jj$j&vr"d||<|j)||||||dz�||=y|j|�y)NTFr"�__wrapped__�
__create_fn__)r0rM�
_recursion�
_recursive�	_readable�_reprrB�len�	_dispatch�getr/�__repr__�_dataclasses�is_dataclass�
isinstance�__dataclass_params__�repr�hasattrr\r5�_pprint_dataclass)r*rrr�	allowance�context�level�objid�rep�	max_width�ps           rrLzPrettyPrinter._format�sA���6�
���G���L�L��F�+�,�"�D�O�"�D�N���j�j���%�0���K�K�&�(�9�4�	��s�8�i�����"�"�4��<�#8�#8�$�?�A��}�!"�����$����	�7�E�A�I�N��E�N���+�+�F�3� ���.��-�-�2�2��&�/�/�=�9�!�V�_�_�%@�%@�%M�%M�M�!"�����&�&�v�v�v�y�'�SX�[\�S\�]��E�N�����S�rc�p�|jj}|t|�dzz
}tj|�D�cgc]1}|j
s�|jt||j�f��3}	}|j|dz�|j|	|||||�|jd�ycc}w)Nr"�(�))
�	__class__r3rbrf�fieldsrj�name�getattrrM�_format_namespace_items)
r*rrrrmrnro�cls_name�f�itemss
          rrlzPrettyPrinter._pprint_dataclass�s����#�#�,�,���#�h�-�!�#�#��<H�<O�<O�PV�<W�b�q�[\�[a�[a�!�&�&�'�&�!�&�&�1�2�b��b����X��^�$��$�$�U�F�F�I�w�PU�V����S���cs�B3�$B3c�N�|j}|d�|jdkDr||jdz
dz�t|�}|rU|jr t	|j�t��}	n|j�}	|j|	|||dz||�|d�y)N�{r"� ��key�})rMrArbrH�sortedr~r;�_format_dict_items)
r*rrrrmrnrorM�lengthr~s
          r�_pprint_dictzPrettyPrinter._pprint_dict�s�������
�c�
��!�!�A�%��4�)�)�A�-��4�5��V��������v�|�|�~�;�?��������#�#�E�6�6�9�q�=�$+�U�
4�
�c�
rc�X�t|�s|jt|��y|j}|j|jdz�|jt
|j��||t|j�zdz|dz||�|jd�y)Nrur"rv)rbrMrjrwr3rL�listr~)r*rrrrmrnro�clss        r�_pprint_ordered_dictz"PrettyPrinter._pprint_ordered_dict�s����6�{��L�L��f��&���������S�\�\�C�'�(����T�&�,�,�.�)�6��c�#�,�,�/�/�!�3�Y��]��e�	%�	���S�rc�z�|jd�|j||||dz||�|jd�y)N�[r"�])rM�
_format_items�r*rrrrmrnros       r�_pprint_listzPrettyPrinter._pprint_list�s9�����S�����6�6�6�9�q�=�"�E�	+����S�rc	��|jd�t|�dk(rdnd}|j||||t|�z||�|j|�y)Nrur"z,)rv)rMrbr�)r*rrrrmrnro�endchars        r�
_pprint_tuplezPrettyPrinter._pprint_tuple�sP�����S���f�+��*�$������6�6�6�9�s�7�|�3K�"�E�	+����W�rc	��t|�s|jt|��y|j}|tur|jd�d}n;|j|j
dz�d}|t|j
�dzz
}t
|t��}|j||||t|�z||�|j|�y)Nr�r��({�})r"r�)	rbrMrjrw�setr3r�r&r�)	r*rrrrmrnro�typr�s	         r�_pprint_setzPrettyPrinter._pprint_sets����6�{��L�L��f��&�������#�:��L�L����G��L�L�����,�-��G��c�#�,�,�'�!�+�+�F���I�.�����6�6�6�9�s�7�|�3K�"�E�	+����W�rc��|j}t|�s|t|��yg}|jd�}	|dk(r
|dz
}|dz
}|j|z
x}
}t|	�D�]\}}
t|
�}|t|	�dz
k(r|
|z}
t|�|
kr|j
|��Htjd|
�}|sJ�|drJ�|j�|}d}t|�D]i\}}||z}|t|�dz
k(r|t|	�dz
k(r||z}tt|��|kDr|r|j
t|��|}�h|}�k|s��|j
t|����t|�dk(r	|�y|dk(r|d�t|�D] \}}|dkDr|dd	|zz�||��"|dk(r	|d
�yy)NTr"z\S*\s*����rurrKr�rv)
rMrbrj�
splitlinesrB�	enumerate�append�re�findall�pop)r*rrrrmrnrorM�chunks�lines�
max_width1rr�i�linerq�parts�
max_width2�current�j�part�	candidates                     r�_pprint_strzPrettyPrinter._pprint_strs��������6�{��$�v�,������!�!�$�'���A�:��a�K�F���N�I�!%���v�!5�5�
�Y� ��'�	1�G�A�t��t�*�C��C��J��N�"��i�'�
��3�x�:�%��
�
�c�"��
�
�9�d�3����u� ��9�$�}��	�	��&�
���(��/�	,�G�A�t� '�$��I��C��J��N�*�q�C��J��N�/B�"�i�/�
��4�	�?�+�j�8�"�"�M�M�$�w�-�8�"&��"+��	,���M�M�$�w�-�0�3	1�4�v�;�!���#�J���A�:��#�J���'�	�F�A�s��1�u��d�S��Z�'�(��#�J�	��A�:��#�J�rc��|j}t|�dkr|t|��y|dk(}|r|dz
}|dz
}|d�d}	t||j|z
|�D]}
||	�||
�|	r�dd|zz}	�|r	|d�yy)N�r"rur�rKr�rv)rMrbrj�_wrap_bytes_reprrB)r*rrrrmrnrorM�parens�delimrqs           r�
_pprint_byteszPrettyPrinter._pprint_bytesGs��������v�;�!���$�v�,����!�����a�K�F���N�I��#�J���#�F�D�K�K�&�,@�)�L�	*�C��%�L��#�J���s�6�z�)��		*�
��#�J�rc	��|j}|d�|jt|�||dz|dz||dz�|d�y)Nz
bytearray(�
r"rv)rMr��bytes)r*rrrrmrnrorMs        r�_pprint_bytearrayzPrettyPrinter._pprint_bytearray\sE������
�l�����5��=�&�&�2�+�$�q�=�'�5�1�9�	>�
�c�
rc��|jd�|j|j�||dz|dz||�|jd�y)Nz
mappingproxy(�
r"rv)rMrL�copyr�s       r�_pprint_mappingproxyz"PrettyPrinter._pprint_mappingproxyesA�����_�%����V�[�[�]�F�F�R�K��Q���e�	%����S�rc�8�t|�tjurd}n|jj}|t|�dzz
}|jj�}|j|dz�|j||||||�|jd�y)N�	namespacer"rurv)
r/�_types�SimpleNamespacerwr3rb�__dict__r~rMr{)	r*rrrrmrnror|r~s	         r�_pprint_simplenamespacez%PrettyPrinter._pprint_simplenamespacems�����<�6�1�1�1�#�H��'�'�0�0�H��#�h�-�!�#�#�����%�%�'�����X��^�$��$�$�U�F�F�I�w�PU�V����S�rc	�J�|j}||jz
}dd|zz}t|�dz
}	t|�D]d\}
\}}|
|	k(}
|j	|||�}||�|d�|j|||t|�zdz|
r|nd||�|
r�]||��fy)N�,
r�r"�: r$)rMrArbr�rarL)r*r~rrrmrnrorM�delimnl�
last_indexr�r��ent�lastrqs               rr�z PrettyPrinter._format_dict_items|s��������$�(�(�(���#��,�&����Z�!�^�
�&�u�-�		�M�A�z��S��
�?�D��*�*�S�'�5�1�C��#�J��$�K��L�L��f�f�s�3�x�&7�!�&;�&*��� �%�
)���g��		rc	�2�|j}dd|zz}t|�dz
}	t|�D]g\}
\}}|
|	k(}
||�|d�t|�|vr	|d�n)|j	|||t|�zdz|
r|nd||�|
r�`||��iy)Nr�r�r"�=�...)rMrbr�r0rL)r*r~rrrmrnrorMr�r�r�r�r�r�s              rr{z%PrettyPrinter._format_namespace_items�s��������#��,�&����Z�!�^�
�&�u�-�
	�M�A�z��S��
�?�D��#�J��#�J��#�w�'�!��e�����S�&�&�3�s�8�*;�a�*?�*.�Y�A�$�e�-���g��
	rc�d�|j}||jz
}|jdkDr||jdz
dz�dd|zz}d}	|j|z
dzx}
}t|�}	t	|�}
d}|s�|
}	t	|�}
|jrI|j|||�}t|�dz}|
|kr|}
|	r|}	|
|k\r|
|z}
||	�d}	||��e||	�|}	|j||||r|nd||�|s��yy#t
$rYywxYw#t
$rd}||z}|
|z}
Y��wxYw)	Nr"r�r�r�FTr$�, )
rMrArB�iter�next�
StopIterationrGrarbrL)r*r~rrrmrnrorMr�r�rrr�it�next_entr�r�rq�ws                  rr�zPrettyPrinter._format_items�sn�������$�(�(�(���!�!�A�%��4�)�)�A�-��4�5��#��,�&���� �K�K�&�0�1�4�4��	�
�%�[��	��B�x�H�����C�
#���8��
�}�}��j�j��g�u�5����H�q�L���1�9�%�E�� '���A�:��Q�J�E��%�L� �E��#�J���%�L��E��L�L��f�f�&*��� �%�
)�/���	��	��!�
#����Y�&�	���"��
#�s$�-D�?D�	D�D�D/�.D/c��|j||j�|j|�\}}}|sd|_|rd|_|S)NFT)rVr�r@r`r_)r*rrnrorjrYrZs       rrazPrettyPrinter._repr�sD��$(�K�K������04���U�%D�!��h�	��"�D�N��"�D�O��rc�*�|j||||�S)z�Format object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        )r)r*rrn�	maxlevelsros     rrVzPrettyPrinter.format�s��
���v�w�	�5�A�Arc�x�t|�s|jt|��y|j|j||�}|j
}|t|j�dzz
}|j|j�d|�dd|z���|j||||dz||�|jd�y)Nr"rur�r�rv)rbrMrjra�default_factoryrwr3r�)	r*rrrrmrnro�rdfr�s	         r�_pprint_default_dictz"PrettyPrinter._pprint_default_dict�s����6�{��L�L��f��&���j�j��/�/��%�@�������#�c�l�l�#�a�'�'�����S�\�\�3��f��E�F����&�&�&�)�a�-��%�P����S�rc��t|�s|jt|��y|j}|j|jdz�|j
dkDr!|j|j
dz
dz�|j
�}|j|||t|j�zdz|dz||�|jd�y)Nr�r"r�r$r�)rbrMrjrwr3rA�most_commonr�)	r*rrrrmrnror�r~s	         r�_pprint_counterzPrettyPrinter._pprint_counter�s����6�{��L�L��f��&���������S�\�\�D�(�)��!�!�A�%��L�L�$�0�0�1�4��;�<��"�"�$������v� &��S�\�\�):� :�Q� >�	�A�
� '��	0�	���T�rc	��t|j�s|jt|��y|j}|j|j
dz�|t|j
�dzz
}t
|j�D]x\}}	|t|j�dz
k(r+|j|	|||dz||�|jd��L|j|	||d||�|jdd|zz��zy)Nrur"rvr�r�)rb�mapsrMrjrwr3r�rL)
r*rrrrmrnror�r��ms
          r�_pprint_chain_mapzPrettyPrinter._pprint_chain_map�s����6�;�;���L�L��f��&���������S�\�\�C�'�(��#�c�l�l�#�a�'�'���f�k�k�*�	3�D�A�q��C����$�q�(�(����Q���	�A�
�w��N����S�!����Q����7�E�B����U�S�6�\�1�2�
	3rc��t|�s|jt|��y|j}|j|jdz�|t|j�dzz
}|jd�|j
�+|j
||||dz||�|jd�y|j
|||d||�|j|j
||�}|jdd|z�d|�d	��y)
Nrur"r�r$z])z],
r�zmaxlen=rv)rbrMrjrwr3�maxlenr�ra)	r*rrrrmrnror��rmls	         r�
_pprint_dequezPrettyPrinter._pprint_deques����6�{��L�L��f��&���������S�\�\�C�'�(��#�c�l�l�#�a�'�'�����S���=�=� ����v�v�v�y�1�}�&��
/��L�L������v�v�v�q�&��
/��*�*�V�]�]�G�U�;�C��L�L�s�V�|�S�A�Brc	�J�|j|j|||||dz
�y�Nr"�rL�datar�s       r�_pprint_user_dictzPrettyPrinter._pprint_user_dict� �����V�[�[�&�&�)�W�e�a�i�Prc	�J�|j|j|||||dz
�yr�r�r�s       r�_pprint_user_listzPrettyPrinter._pprint_user_list r�rc	�J�|j|j|||||dz
�yr�r�r�s       r�_pprint_user_stringz!PrettyPrinter._pprint_user_string%r�rc�j�t|�}|tvrt|�ddfSt|dd�}t	|t
�r3|t
jur!|jr|d�ddfSt|�ddfSt	|t��r
|tjur�|syt|�}|r||k\rdd||vfS||vrt|�ddfSd||<d}d}	g}
|
j}|dz
}|jr t|j�t��}n|j�}|D]S\}
}|j!|
|||�\}}}|j!||||�\}}}||�d	|���|xr|xr|}|s|s�Rd}	�U||=d
dj#|
�z||	fSt	|t$�r|t$jus"t	|t&�r�|t&jur�t	|t$�r|syd
}nt)|�dk(rd}n|syd}t|�}|r||k\r
|dzd||vfS||vrt|�ddfSd||<d}d}	g}
|
j}|dz
}|D]+}|j!||||�\}}}||�|sd}|s�*d}	�-||=|dj#|
�z||	fSt|�}||xr|j+d�dfS)NTFre�_d)z{}TFz{...}r"r�r�z{%s}r�)z[]TFz[%s]z(%s,))z()TFz(%s)r��<)r/�_builtin_scalarsrjrz�
issubclassr>rerI�dictr0r^r�rHr�r~r;rV�joinr��tuplerb�
startswith)r*rrnr�ror��rrprYrZ�
componentsr�r~�k�v�krepr�	kreadable�krecur�vrepr�	vreadable�vrecurrV�o�orepr�	oreadable�orecurrqs                           rrzPrettyPrinter._safe_repr*s���6�l���"�"���<��u�,�,��C��T�*���c�3��A����$5��'�'� ���t�U�2�2��F�|�T�5�0�0��c�4� �Q�$�-�-�%7��(��v�J�E��U�i�/���u��'7�7�7����!�&�)�5�$�6�6��G�E�N��H��I��J��&�&�F��Q�J�E�����v�|�|�~�;�?��������
%���1�+/�;�;��w�	�5�,2�(��y�&�+/�;�;��w�	�5�,2�(��y�&��5�%�0�1�#�?�	�?�i���V� $�I�
%�����D�I�I�j�1�1�8�Y�F�F��s�D�!�a�4�=�=�&8��s�E�"�q�E�N�N�':��#�t�$��,����V���!� ���,����v�J�E��U�i�/���~�u�e�w�.>�>�>����!�&�)�5�$�6�6��G�E�N��H��I��J��&�&�F��Q�J�E��
%��+/�;�;��w�	�5�,2�(��y�&��u�
� �$�H�� $�I�
%�����D�I�I�j�1�1�8�Y�F�F��6�l���S�4�����!4�4�u�<�<r)r"�PNN)7r3r4r5r+rrrrrLrlrcr�r�rer��_collections�OrderedDictr�r�r�r�r�r��	frozensetr�r.r�r�r��	bytearrayr�r��MappingProxyTyper�r�r�r{r�rarVr��defaultdictr��Counterr��ChainMapr��dequer��UserDictr��UserListr��
UserStringrr8rrr	r	js.��-6��4�E�-6�^%�
�
0�*��8��I�
� ,�I�d�m�m��	�4H�I�l�&�&�/�/�0�� ,�I�d�m�m���!.�I�e�n�n���"*�I�c�l�l��$/�I�i� � �!�/�b*�I�c�l�l���&!.�I�e�n�n���%6�I�i� � �!��3G�I�f�%�%�.�.�/��2I�I�f�$�$�-�-�.��"�&')�R�B�	�4H�I�l�&�&�/�/�0��0?�I�l�"�"�+�+�,�
3�1B�I�l�#�#�,�,�-�C�$.;�I�l� � �)�)�*�Q�1B�I�l�#�#�,�,�-�Q�1B�I�l�#�#�,�,�-�Q�3F�I�l�%�%�.�.�/�O=rr	c�L�dt|�j�dt|��d�S)Nz<Recursion on z	 with id=�>)r/r3r0rs rr^r^~s���F�|�$�$�b��j�
2�3rc#�K�d}t|�dzdz}tdt|�d�D]D}|||dz}||z}||k(r||z}tt|��|kDr|r
t|���|}�C|}�F|rt|���yy�w)Nrr�r)rb�rangerj)rrrmr�r�r�r�r�s        rr�r��s������G��v�;�!��a��D�
�1�c�&�k�1�
%�
 ���a��1��~���d�N�	���9��Y��E��t�I���%�'���7�m�#��G��G�
 ���7�m���s�BB)Nr"r
N)r"r
N)"r6�collectionsr�dataclassesrfr��sysrD�typesr��iorrQ�__all__rrr
rrrr&r;r	r
r.r�r�float�complexrFr/r�r^r�r8rr�<module>r#s����4#�"�	���$�"����T�e��P��d�u�P�"'�;�>�>�>�;�;�,,�O=�O=�b�c�5�)�U�G�"�D��J�0�1��3�
r

Zerion Mini Shell 1.0