HEX
Server: LiteSpeed
System: Linux br-asc-web1845.main-hosting.eu 5.14.0-611.42.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 05:30:20 EDT 2026 x86_64
User: u790421558 (790421558)
PHP: 8.2.30
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/rich/__pycache__/pretty.cpython-311.pyc
�

Z�Zg����UddlZddlZddlZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZmZddlm
Z
mZmZddlmZddlmZddlmZddlmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"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dl0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7m8Z8ddl9m:Z:ddl;m<Z<erddl=m>Z>m?Z?m@Z@mAZAmBZBmCZCdedeDfd�ZEdededfd�ZFdeGdeDfd�ZHejIdg��ZJdeGdeDfd�ZK								dpd ed!ed"d#d$d%eDd&eDd'eeLd(eeLd)eeLd*eDde"eMdffd+�ZNdeGd,e"eOe!eOd-ffdeDfd.�ZP								dpd!ed"d#d$d%eDd&eDd'eeLd(eeLd)eeLd*eDddfd/�ZQGd0�d1e7��ZRd2eeefde!eMeMeMffd3�ZSd2eede!eMeMeMffd4�ZTd2d5de!eMeMeMffd6�ZUejVd7�eeUeeSed8�eeTeWd9�e	d:�eXd;�eYd<�e
d=�eZd>�e[d?�ed@�i
Z\eeOeege!eMeMeMfffe]dA<e[e\�^����Z_eWejVee	fZ`dedeDfdB�Zae
GdC�dD����Zbe
GdE�dF����ZcdedeDfdG�Zd			dqd2ed'eeLd(eeLd)eeLdebf
dH�ZedIdJdddddK�d2edLeLdMeLd'eeLd(eeLd)eeLd*eDdeMfdN�ZfddOdddddP�d2ed!ed"d&eDd'eeLd(eeLd)eeLd*eDddfdQ�ZgehdRkr�GdS�dT��ZiddUlmjZjGdV�dWej��ZkeeL��ZldXeldY<ddZd[d\d]hd^�geXhd_���eeYd`gda�i��egdb���dcekdddedfdgdhdig��ei��dj�ZmemdY�nem��ddklompZpepeRemdOdl�m����Gdn�do��ZqepeReq������dSdS)r�N)�array)�Counter�UserDict�UserList�defaultdict�deque)�	dataclass�fields�is_dataclass)�isclass)�islice)�MappingProxyType)
�
TYPE_CHECKING�Any�Callable�DefaultDict�Deque�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�RenderResult�obj�returnc�R�to tjt|����S)z1Check if an object was created with attrs module.)�
_has_attrs�_attr_module�has�type�r1s �>/opt/alt/python311/lib/python3.11/site-packages/rich/pretty.py�_is_attr_objectr:<s���5�,�*�4��9�9�5�5�5�z_attr_module.Attribute[Any]c�V�tr!tjt|����ngS)zGet fields for an attrs object.)r4r5r
r7r8s r9�_get_attr_fieldsr=As#��-7�?�<��t�C�y�y�)�)�)�R�?r;c�x�	|jjjtjt
jfvS#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__�reprlib�	Exceptionr8s r9�_is_dataclass_reprrFFsQ����|�$�0�� ���5
�
�	
�������u�u����s�(+�
9�9�_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�	TypeErrorrG)r1�obj_file�default_repr_files   r9�_has_default_namedtuple_reprrO]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}	t|t��s|�dS|p
t	��}|���5}
t||	��r|���|�t|t��r|nt|||||||d���|dd���ddd��n#1swxYwY|
�
���d��S)	Nr)�ConsoleRenderable�)rSrUrVrWrXrY�marginT�)rT�new_line_start�end�
)rRr[�_safe_isinstancer(r �capture�line�printr#�Pretty�get�rstrip)rQrRrSrTrUrVrWrXrYr[rcs           r9�_ipy_display_hookriqsJ��+�*�*�*�*�*���0�1�1��U�]��t��&����G�	���	�	�
�g��E�#4�5�5�	��L�L�N�N�N��
�
�$�E�>�:�:������%�"/�)�)�'�)��	�	�	����#	�	
�	
�	
�	
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�2�;�;�=�=����%�%�%s�A*B:�:B>�B>�class_or_tuple.c�F�	t||��S#t$rYdSwxYw)zFisinstance can fail in rare cases, for example types with no __class__F)�
isinstancerE)r1rjs  r9rbrb�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.
    rrNrQr2c����|�`��J�dt_��t|t��r|nt|�������������|t_dSdS)z?Replacement sys.displayhook which prettifies objects with Rich.N)rSrUrVrWrXrY)rT)�builtins�_rerbr#rf)	rQrRrTrYrUrXrVrWrSs	 ��������r9�display_hookzinstall.<locals>.display_hook�s�������&�&�&��H�J��M�M�(��~�>�>�
�E�E���!)�&3�#-�#-�"+�#-�����
�
�
�
� �H�J�J�J�'�r;)�
BaseFormatterc�@��eZdZUdZeed<dedef�������fd�ZdS)�install.<locals>.RichFormatterT�pprintrQr2c
�n��|jrt|������������St|��S)N)rRrSrUrVrWrXrY)ruri�repr)	�selfrQrYr rUrXrVrWrSs	  �������r9�__call__z'install.<locals>.RichFormatter.__call__�sP����;�'�,�� +��
�
�!)�&3�#-�#-�"+�#-�	�	�	�	� ��;�;�&r;N)�__name__�
__module__�__qualname__ru�bool�__annotations__rry)rYr rUrXrVrWrSs�������r9�
RichFormatterrt�sq���������F�D����

'�c�

'�c�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'�

'r;rz
text/plain)�richr r�get_ipython�IPython.core.formattersrr�display_formatter�
formatters�	NameError�sys�displayhook)rRrSrTrUrVrWrXrYrq�iprrr�rich_formatterr s````````     @r9�installr��sL�����������0!� � � � � ��&�����G������C��D��������������.G�
�]�]��	:�9�9�9�9�9�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�M�	'�	'�	'�&'�����8F���'��5�5�5��3�'�'�'�&������'���s�A<�<B�Bc���eZdZdZ	d!dddddddddddd�deded	d
ededd
eddeededeedeedeededededdfd�Z						d"d�Z							d#d �Z
dS)$rfakA 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�justifyrS�no_wraprUrVrWrXrYr]�insert_line�_object�highlighterr-r�r�r.rSr/r�rUrVrWrXrYr]r�r2c���||_|p
t��|_||_||_||_||_||_||_|	|_	|
|_
||_||_|
|_
dS�N)r�r&r�r�r�rSr�rUrVrWrXrYr]r�)rxr�r�r�r�rSr�rUrVrWrXrYr]r�s              r9�__init__zPretty.__init__st��"���&�;�/�*;�*;���&���29���4<��
����*���$���$���"���$������&����r;rRr+�optionsr,r0c	#�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�rVrWrXrY�pretty)r�rSr��stylez.__repr__ returned empty stringz
dim italic)r�zrepr.indentrar^)�pretty_reprr�r�r]r�rVrWrXrYr*�	from_ansir�rSr"r�r�r7rU�
ascii_only�with_indent_guidesr�)rxrRr��
pretty_str�pretty_texts     r9�__rich_console__zPretty.__rich_console__0sH����!��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$��.0rds  r9�	<genexpr>z*Pretty.__rich_measure__.<locals>.<genexpr>`s(����C�C�4�����C�C�C�C�C�Cr;r)r�r�r�r�rVrWrXrY�max�
splitlinesr))rxrRr�r��
text_widths     r9�__rich_measure__zPretty.__rich_measure__Ss���!��L��'��(������n���
�
�
�
�HR�X�C�C�C�:�+@�+@�+B�+B�C�C�C�C�C�C�WX�	��:�z�2�2�2r;r�)rRr+r�r,r2r0)rRr+r�r,r2r))rzr{r|�__doc__rr�intr}r�r�r��r;r9rfrf�sm��������,48�'�
�-1�/3�"'�#�$(�$(�#'� ��!�'�'�'��'��/�0�'�
�'��/�*�
'��+�,�'��$��'��'��S�M�'��S�M�'��C�=�'��'��'��'� 
�!'�'�'�'�>!� �!�+;�!�	�!�!�!�!�F3� �3�+;�3�	�3�3�3�3�3�3r;rfr�c�0�d|j�d�dd|j�d�fS)Nzdefaultdict(z, {�})z, {}))�default_factory�r�s r9�_get_braces_for_defaultdictr�es1��6�w�.�6�6�6��9�w�.�9�9�9��r;c�B�|j�dSdd|j�d�d|j�d�fS)N)�deque([�])zdeque()r�z
], maxlen=�)z
deque(maxlen=)�maxlenr�s r9�_get_braces_for_dequer�ms=���~��+�+��&�W�^�&�&�&�)���)�)�)��r;z
array[Any]c�0�d|j�d�dd|j�d�fS)Nzarray(z, [r�r�)�typecoder�s r9�_get_braces_for_arrayr�ws,��,�W�%�,�,�,�d�4R�W�=M�4R�4R�4R�S�Sr;c��dS)N)z	environ({r�zenviron({})r�r�s r9�<lambda>r�|s��!C�r;c��dS)N)z	Counter({r�z	Counter()r�r�s r9r�r�s��=�r;c��dS�N)�{�}z{}r�r�s r9r�r�����*�r;c��dSr�r�r�s r9r�r�����.�r;c��dS)N)zfrozenset({r�zfrozenset()r�r�s r9r�r��s��C�r;c��dS�N)�[�]z[]r�r�s r9r�r��r�r;c��dSr�r�r�s r9r�r��r�r;c��dS)N)r�r�zset()r�r�s r9r�r��s��,�r;c��dS)N)�(r��()r�r�s r9r�r��s��+�r;c��dS)N)zmappingproxy({r�zmappingproxy({})r�r�s r9r�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__)rb�_CONTAINERSr�hasattrr:rr8s r9�
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, �	separatorr2c#��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�)rx�childs  r9r�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_lengthrVc�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%)rxr�rV�total_length�tokens     r9�check_lengthzNode.check_length�sP��$���%�%�'�'�	�	�E��H�U�O�O�+�L��j�(�(��u�u�)��tr;c�T�d�|�����}|S�Nr^)�joinr�)rx�	repr_texts  r9�__str__zNode.__str__�s%���G�G�D�,�,�.�.�/�/�	��r;�Pr�r�r�rYc�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_rootrrrac3�4K�|]}t|��V��dSr�)�strr�s  r9r�zNode.render.<locals>.<genexpr>�s(����9�9�4�S��Y�Y�9�9�9�9�9�9r;)�_Liner��
expandable�expandedr��expandr�)rxr�r�rY�lines�line_nord�repr_strs        r9�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)rzr{r|r�r�r�r~r�r�r�r�r�r}r�r�r�rrr�r�rr�r�r�r�rr�r;r9r�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)r�zA line in repr output.N�parentFr�r�r^�text�suffix�
whitespacer�r�r2c�F�t|jduo|jj��S)z"Check if the line may be expanded.N)r}r�r��rxs r9r�z_Line.expandable�s#���D�I�T�)�@�d�i�.@�A�A�Ar;rVc���t|j��t|j��zt|j��z}|j�J�|j�||��S)z4Check this line fits within a given number of cells.)r�rr%rrr�r�)rxrVr�s   r9r�z_Line.check_length�s\��
��� � �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)rr� rr�)rr�rrr�)rrrr�)r�rr�r�r�r�r�r�r�r!r�r�rr�)rxr�r�r�new_line�child_whitespace�tuple_of_oner�r�r�rds           r9r�z_Line.expandsa�����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�rrr�rrhrs r9r�z
_Line.__str__(sc���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;)rzr{r|r�rrr~r�r}r�r�rr�rrr�r��propertyr�r�r�rr�r�r�r;r9r�r��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;r�c��	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)�getattrrErl�tuple)r1r
s  r9�_is_namedtupler1s]�����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.
    r1r2c�$����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 �>)rb�bytesr�r�rwrE)r1�	truncated�obj_repr�errorrWs    �r9�to_reprztraverse.<locals>.to_reprYs����
�"� ��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	�B���"�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|���}�&|���n2t7����rt%�t��s�|s�t9���r��'|��g}|j}
|rt�jj�d
����}n�t�jj�d�d||�jj�d����}t#�fd�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&k|_+t?���|_,|S)!zWalk the object depth first.z...)r�N�	rich_argsr2c3�K�|D]}t|t��rdt|��dkr|\}}}||kr�7||fV��>t|��dkr|\}}||fV��]t|��dkr
|dV��{|V���dS)N��rr)rbrr�)r"�arg�keyr��defaults     r9�iter_rich_argsz3traverse.<locals>._traverse.<locals>.iter_rich_argsys����� �

�

��#�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)rwr�name�callablerE)�attrrQr�attr_fieldsr1s   ��r9�
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-)r�r�r�r�r�c3�T�K�|]"}|j�	t�|j���|V��#dSr�)rwr�r/)r��fieldr1s  �r9r�z.traverse.<locals>._traverse.<locals>.<genexpr>sU�����-�-���z�-�'.�c�5�:�&>�&>�-��-�-�-�-�-�-r;)r�r�r�r�)r�r�z... +T)r�r�r�)-�idr�r7rrrrr�r�rErr�r�list�	__class__rz�appendr!rbrr�r�r�r:r=rrrrFr
r/rrO�_asdict�itemsr�r�r?r��_MAPPING_CONTAINERS�iterr
�	enumerater�r�)*r1rr �obj_id�obj_type�reached_max_depthr)�fake_attributes�rich_repr_resultr+�args�
class_namer�r9r�r�r&r'r��
child_noder3r/rQ�
repr_callabler5�container_typer�r�r��	num_items�last_item_index�
iter_items�index�iter_valuesr2�	_traverserXrV�pop_visited�push_visitedr�visited_idss*`                                 @�������r9rNztraverse.<locals>._traversems�
������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�
!�
!�[	<�/�[	<��L�� � � ��H��_�F�*�3�/�/�K��)
�$�$+��c�m�.D�+K�+K�+K�L�L�L�D�D��&)�m�&<�#?�#?�#?�$'�!)�!�	���D�&� ��s�C��(�C�5�#�:�:N�1O�'O�!P�Q�&�&�&�&�&�&�&�$?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����������j	<�$�S�$�/�/�j	<�$�j	<�#�3�'�'�	j	<�
�L�� � � ��H��_�F� �
'��#�-�*@�'G�'G�'G�H�H�H����"%�-�"8�;�;�;� #�%�� �]�3�7�7�7�����$-�-�-�-�-�!'����-�-�-�$�$�	'�	'�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��S�	�	�U�*��
�+�C�0�0����s$�B�B"�!B"�*3C�
C+�*C+T)r)Fr)rr��set�add�remover}r�r�)
r�rVrWrXr�rNrOrPrrQs
 ``` @@@@@r9�traverserUDs�����������*�S��S�������  �E�E�K��?�L��$�K�{�{�s�{�$�{�s�{�4�{�{�{�{�{�{�{�{�{�{�{�{�z�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.
    )rVrWrX)r�r�rY)rbr�rUr)	r�r�r�rVrWrXrYr�rs	         r9r�r�nsb��8���&�&�
������
�z�Y�
�
�
���K�K���� ���H��Or;T)rRrUrVrWrXrYc��|�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.
    NrP)rVrWrXrUrYrST)�	soft_wrap)r rerf)r�rRrUrVrWrXrY�_consoles        r9ruru�sf��,!(��{�}�}�}�W�H��N�N���!�!��'�!��	
�	
�	
�������r;�__main__c��eZdZdefd�ZdS)�
BrokenReprr2c��ddzdS)Nrrzthis will failr�rs r9r?zBrokenRepr.__repr__�s��
��E�E�#�#r;N�rzr{r|r�r?r�r;r9r\r\�s/������	$�c�	$�	$�	$�	$�	$�	$r;r\)�
NamedTuplec�N�eZdZUeed<eed<eed<eed<eeed<dS)�StockKeepingUnitr/�description�price�category�reviewsN)rzr{r|r�r~�floatrr�r;r9rara�sI��������	�	�	����������
�
�
��c������r;ra��foozHello World!gZd;�Y@g�ʡE�3t@gcA>�rr%r$r�rg���>rr%r$�crumble)�apple�rhubarb�butter�sugar�flour)rn�orange�pear�kumquatru�Xduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTNzSparkling British Spring WaterzCarbonated spring waterg�������?�waterzits amazing!z
its terrible!)rh�barr�counter�atomic�
namedtuple�Broken)re�)rUrWc��eZdZdefd�ZdS)�Thingr2c��dS)NzHello World!r�rs r9r?zThing.__repr__�s��/�/r;Nr^r�r;r9rr�s/������	0�c�	0�	0�	0�	0�	0�	0r;r)NrPFFNNNF)NNN)rro�collectionsrBrI�osrDr�rrrrrrr	r
rr�	itertoolsr
�typesr�typingrrrrrrrrrrrrr�	rich.reprrr1r5r�r4�ImportErrorr^r �_loopr!�_pickr"�abcr#�cellsr%r�r&�jupyterr'r(�measurer)rr*rRr+r,r-r.r/r0r}r:r=�objectrFr{rGrOr�r�rir7rbr�rfr�r�r��_Environ�dict�	frozensetr7rRrr�r~�keysr�r<r�r�r�rrUr�rurzr\r_ra�d�datar9r�rerr�r;r9�<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�)��)�)�)�)�,$(�!)��� $� $�#��-&�-&��-&�
�i�
 �-&��-&��	-&�
�-&���
�
-&���
�-&���}�-&��-&��3��9��-&�-&�-&�-&�`�	��!&�t�U�4��9�-=�'=�!>��	�����$(�!)��� $� $�#��OG�OG�
�i�
 �OG��OG��OG��	OG�
��
�OG���
�
OG���}�OG��OG�
�OG�OG�OG�OG�de3�e3�e3�e3�e3�\�e3�e3�e3�P��S�#�X�)>��5��c�SV��CW������5��:��%��S�#�
�2F�����T�<�T�E�#�s�C�-�4H�T�T�T�T�
�K�C�C�	� ��,��
=�
=�	� ��
*�
*��.�.�
�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@��@��@�@�@�@�*!%� $�#�	g�g�
�g���
�g���
�g���}�	g�

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

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