Current File : /home/inlingua/miniconda3/lib/python3.1/site-packages/rich/__pycache__/pretty.cpython-312.pyc
�

~�Eg�����UddlZddlZddlZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZmZddlm
Z
mZmZddlmZddlmZddlmZddlmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"dd	l#m$Z$	ddl%Z&e'e&d
�Z(d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�ZHej�dg�ZJdeGdeDfd�ZK								doded ed!d"d#d$eDd%eDd&eeLd'eeLd(eeLd)eDde"eMdffd*�ZNdeGd+e"eOe!eOd,ffdeDfd-�ZP								dod ed!d"d#d$eDd%eDd&eeLd'eeLd(eeLd)eDddfd.�ZQGd/�d0e7�ZRd1eeefde!eMeMeMffd2�ZSd1eede!eMeMeMffd3�ZTd1d4de!eMeMeMffd5�ZUej�d6�eeUeeSed7�eeTeWd8�e	d9�eXd:�eYd;�e
d<�eZd=�e[d>�ed?�i
Z\eeOeege!eMeMeMfffe]d@<e[e\j���Z_eWej�ee	fZ`dedeDfdA�Zae
GdB�dC��Zbe
GdD�dE��ZcdedeDfdF�Zd			dpd1ed&eeLd'eeLd(eeLdebf
dG�ZedHdIdddddJ�d1edKeLdLeLd&eeLd'eeLd(eeLd)eDdeMfdM�ZfddNdddddO�d1ed ed!d%eDd&eeLd'eeLd(eeLd)eDddfdP�ZgehdQk(r�GdR�dS�ZiddTlmjZjGdU�dVej�ZkeeL�ZldWeldX<ddYdZd[d\hd]�geXhd^��eeYd_gd`�i�egda��dbekdcdddedfdgdhg�ei�di�ZmemdXj�em�ddjlompZpepeRemdNdk�l��Gdm�dn�ZqepeReq���yy#e)$rdZ(Y���wxYw)q�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�N�txrtjt|��S)z1Check if an object was created with attrs module.)�
_has_attrs�_attr_module�has�type�r1s �+lib/python3.12/site-packages/rich/pretty.py�_is_attr_objectr:<s���5�,�*�*�4��9�5�5�z_attr_module.Attribute[Any]c�N�trtjt|��SgS)zGet fields for an attrs object.)r4r5r
r7r8s r9�_get_attr_fieldsr=As��-7�<���t�C�y�)�?�R�?r;c��	|jjjtjt
jfvS#t$rYywxYw)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_reprrFFsO����|�|�$�$�0�0�� � ����5
�
�	
������s�?A�	A�
A�_dummy_namedtuplec��d}	tj|j�}tjt
j�}||k(S#ttf$rY�9wxYw)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]s_���H�
��?�?�3�<�<�0��
 ���(9�(B�(B�C���(�(�(��
�Y��
�	
�
�s�A�A�A�value�consoler+�overflowr/�crop�
indent_guides�
max_length�
max_string�	max_depth�
expand_allc	
��ddlm}	t|t�s|�y|xs
t	�}|j�5}
t||	�r|j
�|jt|t�r|nt|||||||d��|dd��ddd�
j�jd�S#1swY�(xYw)	Nr)�ConsoleRenderable�)rRrTrUrVrWrX�marginT�)rS�new_line_start�end�
)rQrZ�_safe_isinstancer(r �capture�line�printr#�Pretty�get�rstrip)rPrQrRrSrTrUrVrWrXrZrbs           r9�_ipy_display_hookrhqs���+���0�1�U�]���&���G�	���	�g��E�#4�5��L�L�N��
�
�$�E�>�:����%�"/�)�)�'�)��	����#	�	
�	
�2�;�;�=����%�%�3
�	�s�AB4�4B=�class_or_tuple.c�:�	t||�S#t$rYywxYw)zFisinstance can fail in rare cases, for example types with no __class__F)�
isinstancerE)r1ris  r9rara�s&����#�~�.�.������s��	�c	�&���������
�ddlm�
�xs�
����J�dtddf��������fd�}	t�}	ddlm}
G��
�����fd�d	|
�}|�}||	jjd
<y#t$r|t_
YywxYw)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.
    rrNrPr2c���|�P��J�dt_�jt|t�r|nt|�����������|t_yy)z?Replacement sys.displayhook which prettifies objects with Rich.N)rRrTrUrVrWrX)rS)�builtins�_rdrar#re)	rPrQrSrXrTrWrUrVrRs	 ��������r9�display_hookzinstall.<locals>.display_hook�sn������&�&�&��H�J��M�M�(��~�>����!)�&3�#-�#-�"+�#-���
�
� �H�J�'r;)�
BaseFormatterc�>��eZdZUdZeed<dedef�������fd�Zy)�install.<locals>.RichFormatterT�pprintrPr2c
�b��|jrt|����������St|�S)N)rQrRrTrUrVrWrX)rtrh�repr)	�selfrPrXr rTrWrUrVrRs	  �������r9�__call__z'install.<locals>.RichFormatter.__call__�s=����;�;�,�� +�
�!)�&3�#-�#-�"+�#-�	�	� ��;�&r;N)�__name__�
__module__�__qualname__rt�bool�__annotations__rrx)rXr rTrWrUrVrRs�������r9�
RichFormatterrs�s%����F�D��

'�c�

'�c�

'�

'r;r~z
text/plain)�richr r�get_ipython�IPython.core.formattersrq�display_formatter�
formatters�	NameError�sys�displayhook)rQrRrSrTrUrVrWrXrp�iprqr~�rich_formatterr s````````     @r9�installr��s�����0!��&���G������C��D���.G�
�]��	:�	'�	'�M�	'�&'���8F����'�'��5��3�'�&���'�s�
A9�9B�Bc��eZdZdZ	ddddddddddddd�deded	d
ededd
eddeededeedeedeededededdfd�Z						dd�Z							dd�Z
y)reakA 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�justifyrR�no_wraprTrUrVrWrXr\�insert_line�_object�highlighterr-r�r�r.rRr/r�rTrUrVrWrXr\r�r2c���||_|xs
t�|_||_||_||_||_||_||_|	|_	|
|_
||_||_|
|_
y�N)r�r&r�r�r�rRr�rTrUrVrWrXr\r�)rwr�r�r�r�rRr�rTrUrVrWrXr\r�s              r9�__init__zPretty.__init__sk��"���&�;�/�*;���&���29���4<��
����*���$���$���"���$������&��r;c	#�K�t|j|j|jz
|j|j
|j|j|j��}tj||jxs|j|jxs|jt|j|j�d��}|r|j|�n"tt!|j��d�d��}|j"r)|j$s|j'|jd��}|j(rd|vrd	��|��y�w)
N��	max_widthr�rUrVrWrX�pretty)r�rRr��stylez.__repr__ returned empty stringz
dim italic)r�zrepr.indentr`r])�pretty_reprr�r�r\r�rUrVrWrXr*�	from_ansir�rRr"r�r�r7rT�
ascii_only�with_indent_guidesr�)rwrQ�options�
pretty_str�pretty_texts     r9�__rich_console__zPretty.__rich_console__0s$����!��L�L��'�'�$�+�+�5��(�(��������n�n����
�
��n�n���L�L�3�G�O�O��]�]�6�g�&6�&6��d�l�l�G�O�O�<��
���
���[�)������%�&�&E�F�"��	����g�&8�&8�%�8�8�� � �
�9��K������ 3��H���s�EEc	��t|j|j|j|j|j
|j|j��}|r td�|j�D��nd}t||�S)Nr�c3�2K�|]}t|����y�wr�r$��.0rcs  r9�	<genexpr>z*Pretty.__rich_measure__.<locals>.<genexpr>`s����C�+B�4����+B���r)r�r�r�r�rUrVrWrX�max�
splitlinesr))rwrQr�r��
text_widths     r9�__rich_measure__zPretty.__rich_measure__Ssw��!��L�L��'�'��(�(��������n�n����
�
�HR�C�C�:�+@�+@�+B�C�C�WX�	��:�z�2�2r;r�)rQr+r�r,r2r0)rQr+r�r,r2r))ryrzr{�__doc__rr�intr|r�r�r��r;r9rere�s���,48�'�
�-1�/3�"'�#�$(�$(�#'� ��!�'��'��/�0�'�
�'��/�*�
'��+�,�'��$��'��'��S�M�'��S�M�'��C�=�'��'��'��'� 
�!'�>!� �!�+;�!�	�!�F3� �3�+;�3�	�3r;rer�c�D�d|j�d�dd|j�d�fS)Nzdefaultdict(z, {�})z, {}))�default_factory�r�s r9�_get_braces_for_defaultdictr�es5��
�w�.�.�1��6��
�w�.�.�1��9��r;c�^�|j�ydd|j�d�d|j�d�fS)N)�deque([�])zdeque()r�z
], maxlen=�)z
deque(maxlen=)�maxlenr�s r9�_get_braces_for_dequer�ms>���~�~��+��
�W�^�^�$�A�&�
����'�q�)��r;z
array[Any]c�D�d|j�d�dd|j�d�fS)Nzarray(z, [r�r�)�typecoder�s r9�_get_braces_for_arrayr�ws0���W�%�%�(��,�d�f�W�=M�=M�<P�PQ�4R�S�Sr;c��y)N)z	environ({r�zenviron({})r�r�s r9�<lambda>r�|s��!Cr;c��y)N)z	Counter({r�z	Counter()r�r�s r9r�r�s��=r;c��y�N)�{�}z{}r�r�s r9r�r�����*r;c��yr�r�r�s r9r�r�����.r;c��y)N)zfrozenset({r�zfrozenset()r�r�s r9r�r��s��Cr;c��y�N)�[�]z[]r�r�s r9r�r��r�r;c��yr�r�r�s r9r�r��r�r;c��y)N)r�r�zset()r�r�s r9r�r��s��,r;c��y)N)�(r��()r�r�s r9r�r��s��+r;c��y)N)zmappingproxy({r�zmappingproxy({})r�r�s r9r�r��s��&Rr;�_BRACESc��t|t�xs&t|�xst|d�xst	|�xrt|�S)z3Check if an object may be expanded by pretty print.�
__rich_repr__)ra�_CONTAINERSr�hasattrr:rr8s r9�
is_expandabler��sO��	��k�*�	 ����	 ��C��)�	 ��3��	�
�c�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�Zy)�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|j��|j��|jr|j��y|j��|jr�|j��|j
rN|jsBt|j�dk(r*|jdj�Ed{���d��nD|jD]5}|j�Ed{���|jr�(|j���7|j��y|j��yy7�l7�B�w)zGenerate tokens for this node.Nrr�,)
r�r�r�r�r�r�r��len�iter_tokensr�r�r�r�)rw�childs  r9r�zNode.iter_tokens�s������=�=��-�-���$�$�$��?�?��/�/�!�
�]�]�
&��}�}��o�o�%��=�=��);�);��D�M�M�@R�VW�@W�#�}�}�Q�/�;�;�=�=�=��I�!%����#(�#4�#4�#6�6�6�$�z�z�"&�.�.�0�"/��&�&�&��j�j� �'�>��7�s*�B:D-�<D)�=+D-�(D+�)D-�:0D-�+D-�start_lengthrUc�\�|}|j�D]}|t|�z
}||kDs�yy)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%)rwr�rU�total_length�tokens     r9�check_lengthzNode.check_length�s:��$���%�%�'�E��H�U�O�+�L��j�(��(�r;c�D�dj|j��}|S�Nr])�joinr�)rw�	repr_texts  r9�__str__zNode.__str__�s���G�G�D�,�,�.�/�	��r;r�r�rXc�(�t|d��g}d}|t|�kr[||}|jr6|js*|s|j	|�s|j|�|||dz|dz
}|t|�kr�[dj
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�2K�|]}t|����y�wr�)�strr�s  r9r�zNode.render.<locals>.<genexpr>�s����9�5�4�S��Y�5�r�)�_Liner��
expandable�expandedr��expandr�)rwr�r�rX�lines�line_norc�repr_strs        r9�renderzNode.render�s����D�$�/�0������E�
�"���>�D����t�}�}��T�%6�%6�y�%A�37�;�;�{�3K�E�'�G�a�K�0��q�L�G���E�
�"��9�9�9�5�9�9���r;)�Pr�F)ryrzr{r�r�r�r}r�r�r�r�r�r|r�r�r�rrr�r�rr�r�r�r�rr�r;r9r�r��s���>��H�c���J����J����K����E�3�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�Zy)r�zA line in repr output.N�parentFr�r�r]�text�suffix�
whitespacer�r�r2c�`�t|jduxr|jj�S)z"Check if the line may be expanded.N)r|r�r��rws r9r�z_Line.expandable�s'���D�I�I�T�)�@�d�i�i�.@�.@�A�Ar;rUc���t|j�t|j�zt|j�z}|j
�J�|j
j
||�S)z4Check this line fits within a given number of cells.)r�rr%rrr�r�)rwrUr�s   r9r�z_Line.check_length�sZ��
���� �8�D�I�I�#6�6��$�+�+�9N�N�	��y�y�$�$�$��y�y�%�%�l�J�?�?r;r�c	#�lK�|j}|�J�|j}|jsJ�|jr4t	|j�|j
�|j��|����}nt	|j|����}|jd|zz}|jxrt|j�dk(}t|j�D].\}}|rdn|j}	t	||||	|xr|��}
|
���0t	|j||j|j����y�w)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�)rwr�r�r�new_line�child_whitespace�tuple_of_oner�r�r�rcs           r9r�z_Line.expands#�����y�y�������_�_�
��}�}��}��=�=�"��
�
��t�'9�'9�&:�4�?�?�:K�L�%���H�
#����J�O�O�H��?�?�S�;�->�>���}�}�@��T�]�]�);�q�)@��$�T�]�]�3�K�D�%�+�����I����+� ��.�,�.��D��J�4���!�!�!��;�;����	
�	
�s�D2D4c��|jr*|j�|j�|jxsd��S|j�|j�|jxsd�|jj���Sr�)r�rrr�rrgrs r9r�z
_Line.__str__(si���9�9��o�o�&�t�y�y�k�$�)�)�/�r�1B�C�C��?�?�#�D�I�I�;�t�y�y��B�.?����@R�@R�@T�?U�V�
r;)ryrzr{r�rrr}r�r|r�r�rr�rrr�r��propertyr�r�r�rr�r�r�r;r9r�r��s��� � $�F�H�W��$��G�T���D�(�4�.���D�#�N��F�C���J����H�d���D�$��
�B�D�B��B�@�s�@�t�@�
�#�
�(�7�*;�
�B��r;r�c��	t|dd�}t|t�xrt|t�S#t$rYywxYw)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)�getattrrErk�tuple)r1r
s  r9�_is_namedtupler1sD�����i��.���c�5�!�?�j���&?�?������s�
1�	=�=c	����������	�dtdtf�fd��t��	�	j��	j�d	dtdt
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������>t|ttf�r(t|��kDrt|��z
}|d��d|��}|S	t	|�}|S#t
$r}dt|��d�}Yd}~|Sd}~wwxYw)z0Get repr string for an object, but catch errors.N�+z<repr-error �>)ra�bytesr�r�rvrE)r1�	truncated�obj_repr�errorrVs    �r9�to_reprztraverse.<locals>.to_reprYs����
�"� ��u�c�l�3��C��:�%��C��:�-�I��k�z�*�-�Q�y�k�:�H���	
:���9������
:�)�#�e�*��q�9�����
:�s�A�	A3�A.�.A3�root�depthc	�X���"�t��}|�)vrtd��St��}�$duxr|�$k\}dtdtt
ttttfffd�}	t�d�}d}|s(	t�d	�rt��s�j�}|��7�'|�t�jd
d�}	t||��}
�jj}|
r�g}|j }
|r#|	rtd|�d���}n�t|�d
���}n�|	rtd|�d�d||d��}nt|�d�d||��}t#|
�D]a\}}t%|t&�r0|\}}�#||dz��}||_||_d|_|
|��F�#||dz��}||_|
|��cnt|	rd|�d�n|�d�g|��}�&|��nt/���rA|�s>�'|�g}|j }
t1���"�"r�|r$t�jj�d
���}n�t�jj�d�d||��}dttttt2t4tgtfff�"�fd�}t#|��D]Q\}\}}}|rtt||����}n
�#||dz��}||_||_d|_|
|��Sn%t�jj�d�g|��}�&|��n�t7���rt%�t�s�|s�t9��r��'|�g}|j }
|r$t�jj�d
���}n�t�jj�d�d||�jj�d���}t#�fd�t;��D��D]M\}}�#t�|j<�|dz��}|j<|_||_d|_|
|��O�&|��n�t?��r�tA��r��'|��jj}|rt|�d
���}ng}|j }
t|�d�d||�d���}t#�jC�jE��D]2\}\}}�#||dz��}||_||_d|_|
|��4�&|��n�t%�tF��r�tFD]}t%�|�s�|}n�'|�tI|��\}}}|rt|�d|����}�n[|jJt��jJk7rt�(��|��}�n$��rg}t||||��}|j }
tM��}|dz
}t%�tN�rjtQ�jE��}�%�tS|�%�}tU|�D]4\} \}}�#||dz��}�(|�|_| |k(|_|
|��6nKtQ��}!�%�tS|!�%�}!tU|!�D]$\} }�#||dz��}| |k(|_|
|��&�%�-|�%kDr(|
td|�%z
��d���nt|g|� �}�&|�nt�(��|��}t��t&k(|_+t?��|_,|S#t$rd}Y���wxYw#t$rY���wxYw)!zWalk the object depth first.z...)r�N�	rich_argsr2c3��K�|D]h}t|t�rRt|�dk(r|\}}}||k(r�-||f���4t|�dk(r|\}}||f���Nt|�dk(s�]|d���e|���jy�w)N��rr)rarr�)r"�arg�keyr��defaults     r9�iter_rich_argsz3traverse.<locals>._traverse.<locals>.iter_rich_argsys}���� ��#�C��/��3�x�1�}�.1�+��U�G�"�e�+�$�!�5�j�(��S��Q��%(�
��U�!�5�j�(��S��Q��!�!�f���I�!�s�AA1�"A1�,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]X}|js�	t�|j�}|j|t|j�r|jndf���Zy#t$r}|j|df��Yd}~�{d}~wwxYw�w)z$Iterate over attr fields and values.N)rvr�name�callablerE)�attrrPr�attr_fieldsr1s   ��r9�
iter_attrsz/traverse.<locals>._traverse.<locals>.iter_attrs�s}�����%0�D�#�y�y�
!&�,3�C����,C�E�)-�	�	�(-�5=�d�i�i�5H��	�	�d�+&�%&�%0��(1�!C�+/�9�9�e�T�*B�$B��!C�s-�B	�A"�5B	�"	B�+B�<B	�B�B	)r�r�r�r�r�c3�f�K�|](}|jrt�|j�r|���*y�wr�)rvr�r/)r��fieldr1s  �r9r�z.traverse.<locals>._traverse.<locals>.<genexpr>s-�����-�!,���z�z�g�c�5�:�:�&>��!,�s�.1)r�r�r�r�)r�r�z... +T)r�r�r�)-�idr�r7rrrrr�r�rErr�r�list�	__class__ry�appendr!rarr�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/rP�
repr_callabler5�container_typer�r�r��	num_items�last_item_index�
iter_items�index�iter_valuesr2�	_traverserWrU�pop_visited�push_visitedr�visited_idss*`                                 @�������r9rNztraverse.<locals>._traversemsN����C����[� ��5�)�)���9��%�T�1�H�e�y�6H��	�c�	�h�u�S�%��S��/�=Q�7R�.S�	� 	$�%��C��O�6:���
��3��0����'*�'8�'8�':�$��'��� ��c�/�/��E�B�G���'7�8�9�D����/�/�J����!����$��#��:�,�d�/C�D��#�*��U�/C�D���#�)*�:�,�a�'8�(+�%-�!%�&)� �� $�*4��Q�'7�(+�%-�!%�	 ��&/�t�_�	��c�+�C��7�),�J�C��)2�5���	�)J�J�.2�J�O�25�J�/�7:�J�4�"�:�.�)2�3�e�a�i�)H�J�.2�J�O�"�:�.�&5��4;��:�,�a�0�J�<�r�AR�����

���
�S�
!�/��� ��H��_�_�F�*�3�/�K��$��c�m�m�.D�.D�-E�U�+K�L�D��&)�m�m�&<�&<�%=�Q�#?�$'�!)�!�	�D�&� ��s�C��(�C�5�#�:�:N�1O�'O�!P�Q�&�$?H�
��>U�:��:�t�U�M�(�)-��]�5�=Q�9R�)S�J�)2�5���	�)J�J�*.�
��.2�
�+�36�
�0��z�*�?V��"%�-�-�"8�"8�!9��<�r�PT���
������$�S�$�/�#�"�3�'��� ��H��_�_�F� ��#�-�-�*@�*@�)A��'G�H���"%�-�-�"8�"8�!9��;� #�%�� �]�]�3�3�4�B�7���$-�-�!'���-�$�K�D�%�
"+�7�3��
�
�+C�5�ST�9�!U�J�*/�*�*�J�'�&*�J�O�/2�J�,��:�&�$�
���
�C�
 �%A�#�%F��� ����/�/�J� ��",��U�3�����!�����",��Q�/� #�%�'�L��+�	��+4�C�K�K�M�4G�4G�4I�*J�&�D�,�3��!*�5���	�!B�J�*-�J�'�&*�J�O�/2�J�,��:�&�+K�
���
�c�;�
/�"-��#�C��8�-�H��#.�

�� �-4�X�->�s�-C�*�J��U� ��*��S��
�'F�G���"�"�d�3�i�&8�&8�8��w�s�|�$�?������)� +�%��	��"������H�	�"+�a�-��#�C�)<�=�!%�c�i�i�k�!2�J�!�-�%+�J�
�%C�
�/8��/D�+��|��U�%.�u�E�A�I�%F�
�.5�c�l�
�+�*/�?�*B�
���z�*�	0E�#'�s�)�K�!�-�&,�[�*�&E��(1�+�(>���u�%.�u�E�A�I�%F�
�*/�?�*B�
���z�*�)?��)�i�*�.D��4�U�9�z�3I�2J�+K�RV�W�X��%�"�4�@������7�3�<�d�;�D��S�	�U�*��
�+�C�0������w�	$�#�O�	$���
��
�s$�'\
�8'\�
\�\�	\)�(\)T)r)Fr)rr��set�add�remover|r�r�)
r�rUrVrWr�rNrOrPrrQs
 ``` @@@@@r9�traverserUDss���*�S��S��  �E�K��?�?�L��$�$�K�{�s�{�$�{�s�{�4�{�{�z�W�4�(�D��Kr;rr�r�r�r�c�r�t|t�r|}nt||||��}|j|||��}|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.
    )rUrVrW)r�r�rX)rar�rUr)	r�r�r�rUrVrWrXr�r�s	         r9r�r�nsI��8���&�����
�z�Y�
���K�K���� ��H��Or;T)rQrTrUrVrWrXc�f�|�
t�n|}|jt||||||d��d��y)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.
    N�ignore)rUrVrWrTrXrRT)�	soft_wrap)r rdre)r�rQrTrUrVrWrX�_consoles        r9rtrt�sD��,!(��{�}�W�H��N�N���!�!��'�!��	
���r;�__main__c��eZdZdefd�Zy)�
BrokenReprr2c��ddzy)Nrrzthis will failr�rs r9r?zBrokenRepr.__repr__�s��
��E�#r;N�ryrzr{r�r?r�r;r9r]r]�s��	$�c�	$r;r])�
NamedTuplec�F�eZdZUeed<eed<eed<eed<eeed<y)�StockKeepingUnitr/�description�price�category�reviewsN)ryrzr{r�r}�floatrr�r;r9rbrb�s!���	������
��c��r;rb��foozHello World!gZd;�Y@g�ʡE�3t@gcA>�rr%r$r�rh���>rr%r$�crumble)�apple�rhubarb�butter�sugar�flour)ro�orange�pear�kumquatrv�Xduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTNzSparkling British Spring WaterzCarbonated spring waterg�������?�waterzits amazing!z
its terrible!)ri�barr�counter�atomic�
namedtuple�Broken)rd�)rTrVc��eZdZdefd�Zy)�Thingr2c��y)NzHello World!r�rs r9r?zThing.__repr__�s��/r;Nr_r�r;r9r�r��s��	0�c�	0r;r�)NrXFFNNNF)NNN)rrn�collectionsrBrI�osrDr�rrrrrrr	r
rr�	itertoolsr
�typesr�typingrrrrrrrrrrrrr�	rich.reprrr1r5r�r4�ImportErrorr]r �_loopr!�_pickr"�abcr#�cellsr%r�r&�jupyterr'r(�measurer)rr*rQr+r,r-r.r/r0r|r:r=�objectrFr|rGrOr�r�rhr7rar�rer�r�r��_Environ�dict�	frozensetr7rRrr�r}�keysr�r<r�r�r�rrUr�rtryr]r`rb�d�datar9rrdr�r�r;r9�<module>r�s-������	��
��G�G�7�7���"����� %�����t�,�J������(�4� �����6��6��6�
@�#�@�(�+H�"I�@�
�F��t��(+�K�*�*�+>��C��)�f�)��)�,$(�!)��� $� $�#��-&��-&�
�i�
 �-&��-&��	-&�
�-&���
�
-&���
�-&���}�-&��-&��3��9��-&�`�	��!&�t�U�4��9�-=�'=�!>��	��$(�!)��� $� $�#��OG�
�i�
 �OG��OG��OG��	OG�
��
�OG���
�
OG���}�OG��OG�
�OG�de3�\�e3�P��S�#�X�)>��5��c�SV��CW���5��:��%��S�#�
�2F��T�<�T�E�#�s�C�-�4H�T�
�K�K�C�	� ��,��
=�	� ��
*��.�
�C��
*��.��	,�	�+��R�>���d�H�c�U�E�#�s�C�-�$8�8�9�9�	:���G�L�L�N�#���R�[�[�*:�H�E���s��t���Q�Q��Q�h�@�@��@�F@��@��@�*!%� $�#�	g�
�g���
�g���
�g���}�	g�

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

���#�"��9�N�O�
��
�	
�&�&�,�%���
�_�-�
��,�? �D�B	��K���t���	�&��T�b�
9�:�0�0�
�&���/��{��o���J��s�3
M%�%M0�/M0