HEX
Server: Apache/2.4.67 (Debian)
System: Linux vps-b2547eb4 6.1.0-41-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
User: root (0)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/rich/__pycache__/pretty.cpython-311.pyc
�

��c����UddlZddlZddlZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZddlmZm
Z
mZddlmZddlmZddlmZddlmZmZmZmZmZmZmZmZmZmZmZm Z dd	l!m"Z"	ddl#Z$e%e$d
��Z&n
#e'$rdZ&YnwxYwdd
l(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5m6Z6ddl7m8Z8ddl9m:Z:erddl;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAdhZBdedeCfd�ZDdededfd�ZEdeFdeCfd�ZGejHdg��ZIdeFdeCfd�ZJ								dod!ed"ed#d$d%d&eCd'eCd(eeKd)eeKd*eeKd+eCddfd,�ZLdeFd-e eMeeMd.ffdeCfd/�ZN								dod"ed#d$d%d&eCd'eCd(eeKd)eeKd*eeKd+eCddfd0�ZOGd1�d2e5��ZPd3eeefdeeQeQeQffd4�ZRd3d5deeQeQeQffd6�ZSejTd7�eeSe
eRed8�ed9�eUd:�ed;�eVd<�eWd=�e	d>�eXd?�eYd@�edA�i
ZZeeMeegeeQeQeQfffe[dB<eYeZ�\����Z]eUejTeefZ^dedeCfdC�Z_eGdD�dE����Z`eGdF�dG����ZadedeCfdH�Zb			dpd3ed(eeKd)eeKd*eeKde`f
dI�ZcdJdKdddddL�d3edMeKdNeKd(eeKd)eeKd*eeKd+eCdeQfdO�ZdddPdddddQ�d3ed"ed#d'eCd(eeKd)eeKd*eeKd+eCddfdR�ZeefdSkr�GdT�dU��ZgddVlmhZhGdW�dXeh��Zie
eK��ZjdYejdZ<dd[d\d]d^hd_�geVhd`���e
eWdagdb�i��egdc���ddeidedfdgdhdidjg��eg��dk�ZkekdZ�lek��ddllmmnZnGdm�dn��ZoenePeo������dSdS)q�N)�array)�Counter�UserDict�UserList�defaultdict�deque)�	dataclass�fields�is_dataclass)�isclass)�islice)�MappingProxyType)�
TYPE_CHECKING�Any�Callable�DefaultDict�Dict�Iterable�List�Optional�Sequence�Set�Tuple�Union)�RichReprResult�ibF���get_console)�	loop_last)�	pick_bool)�RichRenderable��cell_len)�ReprHighlighter)�JupyterMixin�JupyterRenderable)�Measurement)�Text)�Console�ConsoleOptions�HighlighterType�
JustifyMethod�OverflowMethod�RenderResultzmatplotlib.artist.Artist�obj�returnc�R�to tjt|����S)z1Check if an object was created with attrs module.)�
_has_attrs�_attr_module�has�type�r0s �-/usr/lib/python3/dist-packages/rich/pretty.py�_is_attr_objectr9As���5�,�*�4��9�9�5�5�5�z_attr_module.Attribute[Any]c�V�tr!tjt|����ngS)zGet fields for an attrs object.)r3r4r
r6r7s r8�_get_attr_fieldsr<Fs#��-7�?�<��t�C�y�y�)�)�)�R�?r:c�d�	|jjjtjkS#t
$rYdSwxYw)z�Check if an instance of a dataclass contains the default repr.

    Args:
        obj (object): A dataclass instance.

    Returns:
        bool: True if the default repr is used, False if there is a custom repr.
    F)�__repr__�__code__�co_filename�dataclasses�__file__�	Exceptionr7s r8�_is_dataclass_reprrDKs?����|�$�0�K�4H�H�H�������u�u����s�!�
/�/�_dummy_namedtuplec��d}	tj|j��}n#ttf$rYnwxYwtjt
j��}||kS)z�Check if an instance of namedtuple contains the default repr

    Args:
        obj (object): A namedtuple

    Returns:
        bool: True if the default repr is used, False if there's a custom repr.
    N)�inspect�getfiler>�OSError�	TypeErrorrE)r0�obj_file�default_repr_files   r8�_has_default_namedtuple_reprrM_sj���H�
��?�3�<�0�0�����Y��
�
�
�	
��
���� ��(9�(B�C�C���(�(�(s��2�2�ignore�value�consoler*�overflowr.�crop�
indent_guides�
max_length�
max_string�	max_depth�
expand_allc	��ddlm}	ddlm}
t	|t
��s|�dS|p
t
��}|jrbgd�}|D]H}t||d��}
tj
|
��r!	|
��}n#t$rY�?wxYw|�dS�I|	|t��rdSt	||
��r|�
��|�t	|t��r|nt!|||||||d���|d���dS)	Nr)�is_object_one_of_types)�ConsoleRenderable)�_repr_html_�_repr_markdown_�_repr_json_�_repr_latex_�_repr_jpeg_�
_repr_png_�
_repr_svg_�_repr_mimebundle_�)rQrSrTrUrVrW�marginT)rR�new_line_start)�_inspectrYrPrZ�_safe_isinstancer'r�
is_jupyter�getattrrG�ismethodrC�JUPYTER_CLASSES_TO_NOT_RENDER�line�printr"�Pretty)rOrPrQrRrSrTrUrVrWrYrZ�ipython_repr_methods�repr_method�method�repr_results               r8�_ipy_display_hookrsss���1�0�0�0�0�0�*�*�*�*�*�*���0�1�1��U�]����&����G����	 
�	 
�	 
��0�	�	�K��U�K��6�6�F����'�'�	
��"(�&�(�(�K�K�� �����H������*��F�F��"�!�%�)F�G�G�	��F���0�1�1���������M�M��E�>�2�2�	
���
���'�!�!��!��	
�	
�	
��������s�+
A6�6
B�B�class_or_tuple.c�F�	t||��S#t$rYdSwxYw)zFisinstance can fail in rare cases, for example types with no __class__F)�
isinstancerC)r0rts  r8rgrg�s9����#�~�.�.�.�������u�u����s��
 � c	�2���������
�ddlm�
�p	�
�����J�dtddf��������fd�}	t��}	ddlm}
G��
�����fd�d	|
��}|��}||	jjd
<dS#t$r|t_
YdSwxYw)a�Install automatic pretty printing in the Python REPL.

    Args:
        console (Console, optional): Console instance or ``None`` to use global console. Defaults to None.
        overflow (Optional[OverflowMethod], optional): Overflow method. Defaults to "ignore".
        crop (Optional[bool], optional): Enable cropping of long lines. Defaults to False.
        indent_guides (bool, optional): Enable indentation guides. Defaults to False.
        max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
            Defaults to None.
        max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to None.
        max_depth (int, optional): Maximum depth of nested data structures, or None for no maximum. Defaults to None.
        expand_all (bool, optional): Expand all containers. Defaults to False.
        max_frames (int): Maximum number of frames to show in a traceback, 0 for no maximum. Defaults to 100.
    rrNrOr1c����|�`��J�dt_��t|t��r|nt|�������������|t_dSdS)z?Replacement sys.displayhook which prettifies objects with Rich.N)rQrSrTrUrVrW)rR)�builtins�_rmrgr"rn)	rOrPrRrWrSrVrTrUrQs	 ��������r8�display_hookzinstall.<locals>.display_hook�s�������&�&�&��H�J��M�M�#�E�>�:�:�
�����%�"/�)�)�'�)�����
�

�

�

��H�J�J�J�#�r:)�
BaseFormatterc�@��eZdZUdZeed<dedef�������fd�ZdS)�install.<locals>.RichFormatterT�pprintrOr1c
�n��|jrt|������������St|��S)N)rPrQrSrTrUrVrW)rrs�repr)	�selfrOrWrrSrVrTrUrQs	  �������r8�__call__z'install.<locals>.RichFormatter.__call__sP����;�'�,�� +��
�
�!)�&3�#-�#-�"+�#-�	�	�	�	� ��;�;�&r:N)�__name__�
__module__�__qualname__r�bool�__annotations__rr�)rWrrSrVrTrUrQs�������r8�
RichFormatterr~�sq���������F�D����

'�c�

'�c�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'r:r�z
text/plain)�richrr�get_ipython�IPython.core.formattersr|�display_formatter�
formattersrC�sys�displayhook)rPrQrRrSrTrUrVrWr{�ipr|r��rich_formatterrs````````     @r8�installr��sG�����������0!� � � � � ��&�����G������C��D��������������*'�
�]�]��9�9�9�9�9�9�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�M�	'�	'�	'�&'�����8F���'��5�5�5���'�'�'�&������'���s�AA<�<B�Bc���eZdZdZ	d!dddddddddddd�deded	d
ededd
eddeededeedeedeededededdfd�Z						d"d�Z							d#d �Z
dS)$rnakA rich renderable that pretty prints an object.

    Args:
        _object (Any): An object to pretty print.
        highlighter (HighlighterType, optional): Highlighter object to apply to result, or None for ReprHighlighter. Defaults to None.
        indent_size (int, optional): Number of spaces in indent. Defaults to 4.
        justify (JustifyMethod, optional): Justify method, or None for default. Defaults to None.
        overflow (OverflowMethod, optional): Overflow method, or None for default. Defaults to None.
        no_wrap (Optional[bool], optional): Disable word wrapping. Defaults to False.
        indent_guides (bool, optional): Enable indentation guides. Defaults to False.
        max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
            Defaults to None.
        max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to None.
        max_depth (int, optional): Maximum depth of nested data structures, or None for no maximum. Defaults to None.
        expand_all (bool, optional): Expand all containers. Defaults to False.
        margin (int, optional): Subtrace a margin from width to force containers to expand earlier. Defaults to 0.
        insert_line (bool, optional): Insert a new line if the output has multiple new lines. Defaults to False.
    N�Fr)�indent_size�justifyrQ�no_wraprSrTrUrVrWrd�insert_line�_object�highlighterr,r�r�r-rQr.r�rSrTrUrVrWrdr�r1c���||_|p
t��|_||_||_||_||_||_||_|	|_	|
|_
||_||_|
|_
dS�N)r�r%r�r�r�rQr�rSrTrUrVrWrdr�)r�r�r�r�r�rQr�rSrTrUrVrWrdr�s              r8�__init__zPretty.__init__+st��"���&�;�/�*;�*;���&���29���4<��
����*���$���$���"���$������&����r:rPr*�optionsr+r/c	#�K�t|j|j|jz
|j|j|j|j|j���}tj
||jp|j|jp|jt|j|j��d���}|r|�|��n%tt!|j���d�d���}|jr#|js|�|jd���}|jrd|vrd	V�|V�dS)
N��	max_widthr�rTrUrVrW�pretty)r�rQr��stylez.__repr__ returned empty stringz
dim italic)r�zrepr.indent�
�)�pretty_reprr�r�rdr�rTrUrVrWr)�	from_ansir�rQr!r�r�r6rS�
ascii_only�with_indent_guidesr�)r�rPr��
pretty_str�pretty_texts     r8�__rich_console__zPretty.__rich_console__JsH����!��L��'�$�+�5��(������n���
�
�
�
��n���L�3�G�O��]�6�g�&6��d�l�G�O�<�<��
�
�
���
�D���[�)�)�)�����%�%�F�F�F�"����	���	�g�&8�	�%�8�8�� �
�9���K���	��� 3� 3��H�H�H������r:r(c	���t|j|j|j|j|j|j|j���}|r+td�|�	��D����nd}t||��S)Nr�c3�4K�|]}t|��V��dSr�r#��.0rls  r8�	<genexpr>z*Pretty.__rich_measure__.<locals>.<genexpr>zs(����C�C�4�����C�C�C�C�C�Cr:r)r�r�r�r�rTrUrVrW�max�
splitlinesr()r�rPr�r��
text_widths     r8�__rich_measure__zPretty.__rich_measure__ms���!��L��'��(������n���
�
�
�
�HR�X�C�C�C�:�+@�+@�+B�+B�C�C�C�C�C�C�WX�	��:�z�2�2�2r:r�)rPr*r�r+r1r/)rPr*r�r+r1r()r�r�r��__doc__rr�intr�r�r�r��r:r8rnrnsm��������,48�'�
�-1�/3�"'�#�$(�$(�#'� ��!�'�'�'��'��/�0�'�
�'��/�*�
'��+�,�'��$��'��'��S�M�'��S�M�'��C�=�'��'��'��'� 
�!'�'�'�'�>!� �!�+;�!�	�!�!�!�!�F3� �3�+;�3�	�3�3�3�3�3�3r:rnr�c�0�d|j�d�dd|j�d�fS)Nzdefaultdict(z, {�})z, {}))�default_factory�r�s r8�_get_braces_for_defaultdictr�s1��6�w�.�6�6�6��9�w�.�9�9�9��r:z
array[Any]c�0�d|j�d�dd|j�d�fS)Nzarray(z, [�])�))�typecoder�s r8�_get_braces_for_arrayr��s,��,�W�%�,�,�,�d�4R�W�=M�4R�4R�4R�S�Sr:c��dS)N)z	environ({r�zenviron({})r�r�s r8�<lambda>r��s��!C�r:c��dS)N)z	Counter({r�z	Counter()r�r�s r8r�r��s��=�r:c��dS)N)zdeque([r�zdeque()r�r�s r8r�r��s��7�r:c��dS�N)�{�}z{}r�r�s r8r�r�����*�r:c��dSr�r�r�s r8r�r�����.�r:c��dS)N)zfrozenset({r�zfrozenset()r�r�s r8r�r��s��C�r:c��dS�N)�[�]z[]r�r�s r8r�r��r�r:c��dSr�r�r�s r8r�r��r�r:c��dS)N)r�r�zset()r�r�s r8r�r��s��,�r:c��dS)N)�(r��()r�r�s r8r�r��s��+�r:c��dS)N)zmappingproxy({r�zmappingproxy({})r�r�s r8r�r��s��&R�r:�_BRACESc��t|t��p-t|��pt|d��pt	|��ot|��S)z3Check if an object may be expanded by pretty print.�
__rich_repr__)rg�_CONTAINERSr�hasattrr9rr7s r8�
is_expandabler��s]��	��k�*�*�	 �����	 ��C��)�)�	 ��3���	�
�c�l�l�
�r:c	��eZdZUdZdZeed<dZeed<dZeed<dZ	eed<dZ
eed<dZeed	<dZ
eed
<dZeed<dZeeded
<dZeed<dZeed<deefd�Zdededefd�Zdefd�Z	ddedededefd�ZdS)�Nodez4A node in a repr tree. May be atomic or a container.r��key_repr�
value_repr�
open_brace�close_brace�emptyF�last�is_tuple�
is_namedtupleN�childrenz: �
key_separatorz, �	separatorr1c#��K�|jr|jV�|jV�|jr|jV�dS|j��|jr�|jV�|jrI|jsBt|j��dkr*|jd���Ed{V��dV�n4|jD],}|���Ed{V��|j	s	|j
V��-|jV�dS|jV�dSdS)zGenerate tokens for this node.Nrr�,)
r�r�r�r�r�r�r��len�iter_tokensr�r�r�r�)r��childs  r8r�zNode.iter_tokens�sI�����=�	%��-�����$�$�$�$��?�	!��/�!�!�!�!�!�
�]�
&��}�
!��o�%�%�%��=�1��);�1��D�M�@R�@R�VW�@W�@W�#�}�Q�/�;�;�=�=�=�=�=�=�=�=�=��I�I�I�I�!%��1�1��#(�#4�#4�#6�#6�6�6�6�6�6�6�6�$�z�1�"&�.�0�0�0���&�&�&�&�&�&��j� � � � � �'�
&r:�start_lengthrTc�n�|}|���D]}|t|��z
}||krdS�dS)a*Check the length fits within a limit.

        Args:
            start_length (int): Starting length of the line (indent, prefix, suffix).
            max_length (int): Maximum length.

        Returns:
            bool: True if the node can be rendered within max length, otherwise False.
        FT)r�r$)r�r�rT�total_length�tokens     r8�check_lengthzNode.check_length�sP��$���%�%�'�'�	�	�E��H�U�O�O�+�L��j�(�(��u�u�)��tr:c�T�d�|�����}|S�Nr�)�joinr�)r��	repr_texts  r8�__str__zNode.__str__�s%���G�G�D�,�,�.�.�/�/�	��r:�Pr�r�r�rWc�V�t|d���g}d}|t|��krb||}|jr;|js4|s|�|��s|�|��|||dz�<|dz
}|t|��k�bd�d�|D����}|S)alRender the node to a pretty repr.

        Args:
            max_width (int, optional): Maximum width of the repr. Defaults to 80.
            indent_size (int, optional): Size of indents. Defaults to 4.
            expand_all (bool, optional): Expand all levels. Defaults to False.

        Returns:
            str: A repr string of the original object.
        T)�node�is_rootrrr�c3�4K�|]}t|��V��dSr�)�strr�s  r8r�zNode.render.<locals>.<genexpr>�s(����9�9�4�S��Y�Y�9�9�9�9�9�9r:)�_Liner��
expandable�expandedr��expandr�)r�r�r�rW�lines�line_norl�repr_strs        r8�renderzNode.render�s����D�$�/�/�/�0������E�
�
�"�"���>�D���
L�t�}�
L��L�T�%6�%6�y�%A�%A�L�37�;�;�{�3K�3K�E�'�G�a�K�/�0��q�L�G���E�
�
�"�"��9�9�9�9�5�9�9�9�9�9���r:)r�r�F)r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�rrr�r�rr�r�r�r�r	r�r:r8r�r��su�������>�>��H�c�����J������J������K������E�3�O�O�O��D�$�����H�d�����M�4����'+�H�h�t�F�|�$�+�+�+��M�3�����I�s����!�X�c�]�!�!�!�!�,���#��$�����"������
MR�����03��EI��	������r:r�c���eZdZUdZdZeded<dZeed<dZ	ee
ed<dZeed<dZ
eed	<dZeed
<dZeed<dZeed<ed
efd���Zded
efd�Zded
edfd�Zd
efd�ZdS)rzA line in repr output.N�parentFr�r�r��text�suffix�
whitespacerr�r1c�F�t|jduo|jj��S)z"Check if the line may be expanded.N)r�r�r��r�s r8rz_Line.expandable
s#���D�I�T�)�@�d�i�.@�A�A�Ar:rTc���t|j��t|j��zt|j��z}|j�J�|j�||��S)z4Check this line fits within a given number of cells.)r�rr$rr
r�r�)r�rTr�s   r8r�z_Line.check_lengths\��
��� � �8�D�I�#6�#6�6��$�+�9N�9N�N�	��y�$�$�$��y�%�%�l�J�?�?�?r:r�c#��K�|j}|�J�|j}|jsJ�|jr)t	|j�|j�|j��|���V�}nt	|j|���V�}|jd|zz}|jot|j��dk}t|j��D]+\}}|rdn|j
}	t	||||	|o|���}
|
V��,t	|j||j|j
���V�dS)z6Expand this line by adding children on their own line.N)rr� rr�)rr�rr
r�)rrr
r�)r�rr�r�rr�r�r�r�r r�r�r
r�)r�r�r�r�new_line�child_whitespace�tuple_of_oner�r�r�rls           r8rz_Line.expandsb�����y�������_�
��}�����=�	P�"��
�L�t�'9�L�4�?�L�L�%������H�H�
#���J�O�O�O�O�O�H��?�S�;�->�>���}�@��T�]�);�);�q�)@��$�T�]�3�3�		�		�K�D�%�+�?�����I����+� ��.�,�.����D��J�J�J�J���!�!��;���	
�
�
�	
�	
�	
�	
�	
r:c��|jr|j�|j�|jpd��S|j�|j�|jpd�|j�����Sr�)r�rrr�r
�rstriprs r8r�z
_Line.__str__8sc���9�	��o�C�t�y�C�$�)�/�r�C�C�C��?�V�D�I�V�t�y��B�V���@R�@R�@T�@T�V�V�
r:)r�r�r�r�rrr�r�r�r�r�rrr
rrr��propertyrr�r�rrr�r�r:r8rr�s7������� � � $�F�H�W��$�$�$��G�T�����D�(�4�.�����D�#�N�N�N��F�C�����J������H�d�����D�$����
�B�D�B�B�B��X�B�@�s�@�t�@�@�@�@�
�#�
�(�7�*;�
�
�
�
�B�������r:rc��	t|dd��}n#t$rYdSwxYwt|t��ot|t��S)aXChecks if an object is most likely a namedtuple. It is possible
    to craft an object that passes this check and isn't a namedtuple, but
    there is only a minuscule chance of this happening unintentionally.

    Args:
        obj (Any): The object to test

    Returns:
        bool: True if the object is a namedtuple. False otherwise.
    �_fieldsNF)rirCrv�tuple)r0r
s  r8�_is_namedtuplerAs]�����i��.�.���������u�u������c�5�!�!�?�j���&?�&?�?s��
"�"c	����������	�dtdtf�fd��t���	�	j��	j�ddtdt
dtdtf�������	fd�
��|d	�
��}|S)a`Traverse object and generate a tree.

    Args:
        _object (Any): Object to be traversed.
        max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
            Defaults to None.
        max_string (int, optional): Maximum length of string before truncating, or None to disable truncating.
            Defaults to None.
        max_depth (int, optional): Maximum depth of data structures, or None for no maximum.
            Defaults to None.

    Returns:
        Node: The root of a tree structure which can be used to render a pretty repr.
    r0r1c�$����Qt|ttf��r5t|���kr"t|���z
}|d���d|��}n;	t	|��}n*#t
$r}dt|���d�}Yd}~nd}~wwxYw|S)z0Get repr string for an object, but catch errors.N�+z<repr-error �>)rg�bytesrr�r�rC)r0�	truncated�obj_repr�errorrUs    �r8�to_reprztraverse.<locals>.to_repris����
�"� ��u�c�l�3�3�
#��C���:�%�%��C���:�-�I��k�z�k�*�:�:�y�:�:�H�H�
:���9�9�����
:�
:�
:�9�#�e�*�*�9�9�9�����������
:�����s�A&�&
B
�0B�B
Fr�root�depthc	����"�t���}|�)vrtd���St���}�$duo|�$k}dtdtt
ttttfffd�}	t�d��}n#t$rd}YnwxYwd}|sE	t�d	��r#t���s����}n#t$rYnwxYw|��[�'|��t�jd
d��}	t||����}
�jj}|
r�g}|j}
|r+|	rtd|�d����}n�t|�d
����}n�|	rtd|�d�d||d���}nt|�d�d||���}t#|
��D]r\}}t%|t&��r6|\}}�#||dz���}||_||_d|_|
|���P�#||dz���}||_|
|���snt|	rd|�d�n|�d�g|���}�&|���n�t/����r`|�s]�'|��g}|j}
t1����"�"�r|rt�jj�d
����}�n	t�jj�d�d||���}dttttt2t4tgtfff�"�fd�}t#|����D]b\}\}}}|r'tt||�������}n�#||dz���}||_||_d|_|
|���cnt�jj�d�g|���}�&|���n!t7���r�t%�t��s�|s�t9���r��'|��g}|j}
|rt�jj�d
����}n�t�jj�d�d||���}t#d�t;���D����D]M\}}�#t�|j��|dz���}|j|_||_d|_|
|���N�&|���nt?���r�tA���r��'|���jj}|rt|�d
����}n�g}|j}
t|�d�d||�d����}t#��!���"����D]8\}\}}�#||dz���}||_||_d|_|
|���9�&|���n1t%�tF���rtFD]}t%�|��r|}n��'|��tI|���\}}}|rt|�d|�����}�n�|j%t���j%krt�(���|���}�na��rLg}t||||���}|j}
tM���}|dz
}t%�tN��r�tQ��"����}�%�tS|�%��}tU|��D]>\} \}}�#||dz���}�(|��|_| |k|_|
|���?n\tQ���}!�%�tS|!�%��}!tU|!��D]+\} }�#||dz���}| |k|_|
|���,�%�&|�%kr |
td|�%z
��d�����nt|g|���}�&|��nt�(���|���}t%�t&��|_+t?���|_,|S) zWalk the object depth first.z...)r�N�	rich_argsr1c3�K�|D]}t|t��rdt|��dkr|\}}}||kr�7||fV��>t|��dkr|\}}||fV��]t|��dkr
|dV��{|V���dS)N��rr)rgrr�)r*�arg�keyr��defaults     r8�iter_rich_argsz3traverse.<locals>._traverse.<locals>.iter_rich_args�s����� �

�

��#�C��/�/���3�x�x�1�}�}�.1�+��U�G�"�e�+�+�$�!�5�j�(�(�(�(��S���Q���%(�
��U�!�5�j�(�(�(�(��S���Q���!�!�f������I�I�I�I�

�

r:�,awehoi234_wdfjwljet234_234wdfoijsdfmmnxpi492Fr��angular�<z...>z(...)rr!)r�r�r�r�r�r�r�)r�r�r�r�r)r(�=r�)r�r�r�c3���K��D]j}|jra	t�|j��}|j|t|j��r|jndfV��G#t$r}|j|dfV�Yd}~�bd}~wwxYw�kdS)z$Iterate over attr fields and values.N)r�ri�name�callablerC)�attrrOr%�attr_fieldsr0s   ��r8�
iter_attrsz/traverse.<locals>._traverse.<locals>.iter_attrs�s������%0�&�&�D�#�y�&�
!&�,3�C���,C�,C�E�)-�	�(-�5=�d�i�5H�5H�(R��	�	�d�+&�%&�%&�%&�%&��	(1�!C�!C�!C�+/�9�e�T�*B�$B�$B�$B�$B�$B�$B�$B�$B�����!C����&�&�&s�A
�
A-�A(�(A-c3�(K�|]
}|j�	|V��dSr�)r�)r��fields  r8r�z.traverse.<locals>._traverse.<locals>.<genexpr>s=����-�-�#�e�j�-��-�-�-�-�-�-r:)r�r�r�r�)r�r�z... +T)r�r�r�)-�idr�r6rrrrrr�rCrr�ri�list�	__class__r��appendr rgrr�r�r�r9r<rrrrDr
r7rrM�_asdict�itemsr�r�r>r��_MAPPING_CONTAINERS�iterr
�	enumerater�r�)*r0r'r(�obj_id�obj_type�reached_max_depthr1�fake_attributes�rich_repr_resultr3�args�
class_namer�rAr�r�r.r/r��
child_noder;r7rO�
repr_callabler=�container_typer�r�r��	num_items�last_item_index�
iter_items�index�iter_valuesr:�	_traverserVrT�pop_visited�push_visitedr&�visited_idss*`                                 @�������r8rVztraverse.<locals>._traverse}ss
������C�����[� � ��5�)�)�)�)���9�9��%�T�1�H�e�y�6H��	�c�	�h�u�S�%��S��/�=Q�7R�.S�	�	�	�	� 	$�%��C���O�O���	$�	$�	$�#�O�O�O�	$����6:���	�
��3��0�0�;�����;�'*�'8�'8�':�':�$����
�
�
���
�����'��L�� � � ��c�/��E�B�B�G����'7�8�8�9�9�D���/�J��*
���!���$� /��E�#�/C�:�/C�/C�/C�D�D�D���#�*�/C�/C�/C�D�D�D�����#�'8�:�'8�'8�'8�(+�%-�!%�&)� � � ��� $�*4�'7�'7�'7�(+�%-�!%�	 � � ��&/�t�_�_�/�/�	��c�+�C��7�7�
/�),�J�C��)2��5���	�)J�)J�)J�J�.2�J�O�25�J�/�7:�J�4�"�F�:�.�.�.�.�)2��3�e�a�i�)H�)H�)H�J�.2�J�O�"�F�:�.�.�.�.�/��4;�R�0�:�0�0�0�0�J�AR�AR�AR�������

�K������
�S�
!�
!�X	<�/�X	<��L�� � � ��H��_�F�*�3�/�/�K��)
�$�$+��c�m�.D�+K�+K�+K�L�L�L�D�D��&)�m�&<�#?�#?�#?�$'�!)�!�	���D�&���c�3���3�%��*�1E�(F�F�G�)�&�&�&�&�&�&�&�$?H�
�
���>U�>U�+�+�:��:�t�U�M�(�K�)-��]�]�5�=Q�=Q�9R�9R�)S�)S�)S�J�J�)2��5���	�)J�)J�)J�J�*.�
��.2�
�+�36�
�0���z�*�*�*�*�+��"%�-�"8�<�<�<�r�PT�����
�K����������g	<�$�S�$�/�/�g	<�$�g	<�#�3�'�'�	g	<�
�L�� � � ��H��_�F� �
'��#�-�*@�'G�'G�'G�H�H�H����"%�-�"8�;�;�;� #�%��	����$-�-�-�'-�c�{�{�-�-�-�$�$�'�'�K�D�%�"+��7�3��
�+C�+C�5�ST�9�!U�!U�!U�J�*/�*�J�'�&*�J�O�/2�J�,��F�:�&�&�&�&��K������
�C�
 �
 �J	<�%A�#�%F�%F�J	<��L�� � � ���/�J� �
'��",�3�3�3��������!����",�/�/�/� #�%�'�+�+�+�	����+4�C�K�K�M�M�4G�4G�4I�4I�*J�*J�'�'�&�D�,�3��!*��5���	�!B�!B�!B�J�*-�J�'�&*�J�O�/2�J�,��F�:�&�&�&�&��K������
�c�;�
/�
/�2	<�"-�
�
��#�C��8�8��-�H��E��
�L�� � � �-4�X�->�s�-C�-C�*�J��U� �$
A��*�'F�'F��'F�'F�G�G�G����"�d�3�i�i�&8�8�8��w�w�s�|�|�$�?�?�?���� 
A����)� +�%��	����"�����H�H�	�"+�a�-��#�C�)<�=�=�+�!%�c�i�i�k�k�!2�!2�J�!�-�%+�J�
�%C�%C�
�/8��/D�/D�+�+�+��|��U�%.�Y�u�E�A�I�%F�%F�%F�
�.5�g�c�l�l�
�+�*/�?�*B�
����z�*�*�*�*�	+�#'�s�)�)�K�!�-�&,�[�*�&E�&E��(1�+�(>�(>�+�+���u�%.�Y�u�E�A�I�%F�%F�%F�
�*/�?�*B�
����z�*�*�*�*��)�i�*�.D�.D��F�4�+K�9�z�3I�+K�+K�RV�W�W�W�X�X�X���%�"�4�@�@�@���K�������7�7�3�<�<�d�;�;�;�D�(��e�4�4��
�+�C�0�0����s$�B�B"�!B"�*3C�
C+�*C+T)r')Fr)rr�set�add�remover�r�r�)
r�rTrUrVr�rVrWrXr&rYs
 ``` @@@@@r8�traverser]Ts�����������*�S��S�������  �E�E�K��?�L��$�K�x�x�s�x�$�x�s�x�4�x�x�x�x�x�x�x�x�x�x�x�x�t�9�W�4�(�(�(�D��Kr:r�r�r�r�r�c��t|t��r|}nt||||���}|�|||���}|S)a�Prettify repr string by expanding on to new lines to fit within a given width.

    Args:
        _object (Any): Object to repr.
        max_width (int, optional): Desired maximum width of repr string. Defaults to 80.
        indent_size (int, optional): Number of spaces to indent. Defaults to 4.
        max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
            Defaults to None.
        max_string (int, optional): Maximum length of string before truncating, or None to disable truncating.
            Defaults to None.
        max_depth (int, optional): Maximum depth of nested data structure, or None for no depth.
            Defaults to None.
        expand_all (bool, optional): Expand all containers regardless of available width. Defaults to False.

    Returns:
        str: A possibly multi-line representation of the object.
    )rTrUrV)r�r�rW)rgr�r]r	)	r�r�r�rTrUrVrWr�rs	         r8r�r�{sb��8���&�&�
������
�z�Y�
�
�
���K�K���� ���H��Or:T)rPrSrTrUrVrWc��|�t��n|}|�t||||||d���d���dS)a�A convenience function for pretty printing.

    Args:
        _object (Any): Object to pretty print.
        console (Console, optional): Console instance, or None to use default. Defaults to None.
        max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
            Defaults to None.
        max_string (int, optional): Maximum length of strings before truncating, or None to disable. Defaults to None.
        max_depth (int, optional): Maximum depth for nested data structures, or None for unlimited depth. Defaults to None.
        indent_guides (bool, optional): Enable indentation guides. Defaults to True.
        expand_all (bool, optional): Expand all containers. Defaults to False.
    NrN)rTrUrVrSrWrQT)�	soft_wrap)rrmrn)r�rPrSrTrUrVrW�_consoles        r8rr�sf��,!(��{�}�}�}�W�H��N�N���!�!��'�!��	
�	
�	
�������r:�__main__c��eZdZdefd�ZdS)�
BrokenReprr1c��ddzdS)Nrrzthis will failr�rs r8r>zBrokenRepr.__repr__�s��
��E�E�#�#r:N�r�r�r�rr>r�r:r8rdrd�s/������	$�c�	$�	$�	$�	$�	$�	$r:rd)�
NamedTuplec�N�eZdZUeed<eed<eed<eed<eeed<dS)�StockKeepingUnitr7�description�price�category�reviewsN)r�r�r�rr��floatrr�r:r8riri�sI��������	�	�	����������
�
�
��c������r:ri��foozHello World!gZd;�Y@g�ʡE�3t@gcA>�rr-r,r�ro���>rr-r,�crumble)�apple�rhubarb�butter�sugar�flour)rv�orange�pear�kumquatr}�Xduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTNzSparkling British Spring WaterzCarbonated spring waterg�������?�waterzits amazing!z
its terrible!)rp�barr�counter�atomic�
namedtuple�Broken)rmc��eZdZdefd�ZdS)�Thingr1c��dS)NzHello World!r�rs r8r>zThing.__repr__s��/�/r:Nrfr�r:r8r�r�s/������	0�c�	0�	0�	0�	0�	0�	0r:r�)NrNFFNNNF)NNN)pry�collectionsrArG�osr�rrrrrrr	r
rr�	itertoolsr
�typesr�typingrrrrrrrrrrrr�	rich.reprrr9r4r�r3�ImportErrorr�r�_loopr �_pickr!�abcr"�cellsr$r�r%�jupyterr&r'�measurer(rr)rPr*r+r,r-r.r/rkr�r9r<�objectrDr�rErMr�rsr6rgr�rnrr�r��_Environ�dict�	frozensetr?rZrr�r��keysr�rDr�r�rrr]r�rr�rdrgri�d�datarAr�rmr�r�r:r8�<module>r�s�
�������������������	�	�	�	�
�
�
�
�������G�G�G�G�G�G�G�G�G�G�G�G�G�G�7�7�7�7�7�7�7�7�7�7�������������"�"�"�"�"�"�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�%�$�$�$�$�$���������t�,�,�J�J�������J�J�J�����������������������������������(�(�(�(�(�(�4�4�4�4�4�4�4�4� � � � � � ��������������������������!��6��6��6�6�6�6�
@�#�@�(�+H�"I�@�@�@�@�
�F��t�����"+�K�*�+>��C�C��)�f�)��)�)�)�)�,$(�!)��� $� $�#��H�H��H�
�i�
 �H��H��	H�
�H���
�
H���
�H���}�H��H�
�H�H�H�H�V�	��!&�t�U�4��9�-=�'=�!>��	�����$(�!)��� $� $�#��L'�L'�
�i�
 �L'��L'��L'��	L'�
��
�L'���
�
L'���}�L'��L'�
�L'�L'�L'�L'�^e3�e3�e3�e3�e3�\�e3�e3�e3�P��S�#�X�)>��5��c�SV��CW�����T�<�T�E�#�s�C�-�4H�T�T�T�T�
�K�C�C�	� ��,��
=�
=�	�7�7��
*�
*��.�.�
�C�C��
*�
*��.�.��	,�	,�	�+�+��R�R�>���d�H�c�U�E�#�s�C�-�$8�8�9�9�	:�����e�G�L�L�N�N�#�#���R�[�*:�H�E���s��t������Q�Q�Q�Q�Q�Q�Q���Q�h�@�@�@�@�@�@�@���@�F@��@��@�@�@�@�*!%� $�#�	d�d�
�d���
�d���
�d���}�	d�

�d�d�d�d�T	�� $� $�#��%�%�%�
�%��%��	%�
��
�%���
�
%���}�%��%�	�%�%�%�%�V$(�� $� $�#��"�"�"�
�"��i�
 �"��	"�
��
�"���
�
"���}�"��"�
�"�"�"�"�J�z���$�$�$�$�$�$�$�$�
"�!�!�!�!�!������:����	��C���A��A�e�H�
�����&�&�&�

��y����#�#�"�{��9�N�N�N�O�
�
��7�
�
�
�	
�	
�&�&�&�,�%���
�_�-�
�
��*�,�,�? � �D�B	��K���t����������0�0�0�0�0�0�0�0�
�E�&�&�����/�/������{�s�-A>�>B�B