o
    Ëý°j<  ã                   @   sÞ  U d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZm	Z	m
Z
mZmZ d dlmZmZmZ d dlmZ d dlmZ d dlmZ d dlmZmZmZmZmZmZmZmZmZmZm Z  d d	l!m"Z" zd dl#Z$W n e%yz   dZ$Y nw d
dl&m'Z' d
dl(m)Z) d
dl*m+Z+ d
dl,m-Z- d
dl.m/Z/ d
dl0m1Z1 d
dl2m3Z3m4Z4 d
dl5m6Z6 d
dl7m8Z8 erÅd
dl9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z? dede@fdd„ZAdeded fdd„ZBdeCde@fdd„ZD							djd ed!ed" d#d$d%e@d&e@d'eeE d(eeE d)e@ddfd*d+„ZF							djd!ed" d#d$d%e@d&e@d'eeE d(eeE d)e@ddfd,d-„ZGG d.d/„ d/e3ƒZHd0eeef deeIeIeIf fd1d2„ZJd0d3deeIeIeIf fd4d5„ZKejLd6d7„ eeKeeJed8d7„ ed9d7„ eMd:d7„ e	d;d7„ eNd<d7„ eOd=d7„ e
d>d7„ ePd?d7„ eQd@d7„ edAd7„ iZReeSeegeeIeIeIf f f eTdB< eQeR U¡ ƒZVeMejLee	fZWdede@fdCdD„ZXeG dEdF„ dFƒƒZYeG dGdH„ dHƒƒZZ			dkd0ed'eeE d(eeE dIeeE deYf
dJdK„Z[dLdMdddddNœd0edOeEdPeEd'eeE d(eeE dIeeE d)e@deIfdQdR„Z\ddSdddddTœd0ed!ed" d&e@d'eeE d(eeE dIeeE d)e@ddfdUdV„Z]e^dWk�rmG dXdY„ dYƒZ_eeEƒZ`dZe`d[< d
d\d]d^d_h d`£geNh da£ƒeeOdbg dc¢iƒeg dd¢ƒdee_ƒ dfœZaead[  bea¡ d dglcmdZd edeHeadSdhdi�ƒ dS dS )lé    N)Úarray)ÚCounterÚUserDictÚUserListÚdefaultdictÚdeque)Ú	dataclassÚfieldsÚis_dataclass)Úisclass)Úislice)ÚMappingProxyType)ÚTYPE_CHECKINGÚAnyÚCallableÚDefaultDictÚDictÚIterableÚListÚOptionalÚSetÚTupleÚUnion)ÚRichReprResulté   ©Úget_console)Ú	loop_last)Ú	pick_bool)ÚRichRenderable©Úcell_len)ÚReprHighlighter)ÚJupyterMixinÚJupyterRenderable)ÚMeasurement)ÚText)ÚConsoleÚConsoleOptionsÚHighlighterTypeÚJustifyMethodÚOverflowMethodÚRenderResultÚobjÚreturnc                 C   s   t duo
t  t| ƒ¡S )z1Check if an object was created with attrs module.N)Ú_attr_moduleÚhasÚtype©r-   © r3   úŠ/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/pip/_vendor/rich/pretty.pyÚ_is_attr_object8   s   r5   z_attr_module.Attribute[Any]c                 C   s   t durt  t| ƒ¡S g S )zGet fields for an attrs object.N)r/   r	   r1   r2   r3   r3   r4   Ú_get_attr_fields=   s   r6   c                 C   s(   z	| j jjtjkW S  ty   Y dS w )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__Ú	Exceptionr2   r3   r3   r4   Ú_is_dataclass_reprB   s
   ÿr=   ÚignoreFÚvalueÚconsoler'   Úoverflowr+   ÚcropÚindent_guidesÚ
max_lengthÚ
max_stringÚ
expand_allc              
   C   sÌ   ddl m} t| tƒs| d u rd S |ptƒ }|jrCg d¢}	|	D ]#}
t| |
d ƒ}t |¡rBz|ƒ }W n	 t	y:   Y qw |d urB d S qt| |ƒrL| 
¡  |jt| tƒrU| n
t| |||||dd�|dd� d S )Nr   )ÚConsoleRenderable)Ú_repr_html_Ú_repr_markdown_Ú_repr_json_Ú_repr_latex_Ú_repr_jpeg_Ú
_repr_png_Ú
_repr_svg_Ú_repr_mimebundle_é   )rA   rC   rD   rE   rF   ÚmarginT)rB   Únew_line_start)r@   rG   Ú
isinstancer$   r   Ú
is_jupyterÚgetattrÚinspectÚismethodr<   ÚlineÚprintr   ÚPretty)r?   r@   rA   rB   rC   rD   rE   rF   rG   Úipython_repr_methodsÚrepr_methodÚmethodÚrepr_resultr3   r3   r4   Ú_ipy_display_hookS   sD   




ÿ€
ÿù	
ór_   c                    s¨   ddl m‰ ˆ p
ˆƒ ‰ ˆ dusJ ‚dtddf‡ ‡‡‡‡‡‡fdd„}z$tƒ }ddlm}	 G ‡‡‡‡‡‡fd	d
„d
|	ƒ}
|
ƒ }||jjd< W dS  tyS   |t	_
Y dS w )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.
        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.
    r   r   Nr?   r.   c              	      sT   | dur(ˆ dus
J ‚dt _ˆ jt| tƒr| n	t| ˆˆˆˆˆd�ˆd� | t _dS dS )z?Replacement sys.displayhook which prettifies objects with Rich.N)rA   rC   rD   rE   rF   )rB   )ÚbuiltinsÚ_rY   rS   r   rZ   )r?   )r@   rB   rF   rC   rD   rE   rA   r3   r4   Údisplay_hook®   s$   ÿúõ
ðzinstall.<locals>.display_hook)ÚBaseFormatterc                       s:   e Zd ZU dZeed< dedef‡ ‡‡‡‡‡fdd„ZdS )zinstall.<locals>.RichFormatterTÚpprintr?   r.   c              	      s&   | j rt|ˆƒ ˆˆˆˆˆ d�S t|ƒS )N)r@   rA   rC   rD   rE   rF   )rd   r_   Úrepr)Úselfr?   ©rF   r   rC   rD   rE   rA   r3   r4   Ú__call__É   s   ù
z'install.<locals>.RichFormatter.__call__N)Ú__name__Ú
__module__Ú__qualname__rd   ÚboolÚ__annotations__r   rh   r3   rg   r3   r4   ÚRichFormatterÆ   s   
 $rn   z
text/plain)Úpip._vendor.richr   r   Úget_ipythonÚIPython.core.formattersrc   Údisplay_formatterÚ
formattersr<   ÚsysÚdisplayhook)r@   rA   rB   rC   rD   rE   rF   rb   Úiprc   rn   Úrich_formatterr3   )r@   rB   rF   r   rC   rD   rE   rA   r4   Úinstall“   s   
"ÿrx   c                   @   s¸   e Zd ZdZ	d$ddddddddddddœdeded	 d
eded ded dee dedee dee dee dedededdfdd„Z						d%dd „Z							!d&d"d#„Z
dS )'rZ   ak  A 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ÚjustifyrA   Úno_wraprC   rD   rE   Ú	max_depthrF   rQ   Úinsert_lineÚ_objectÚhighlighterr)   rz   r{   r*   rA   r+   r|   rC   rD   rE   r}   rF   rQ   r~   r.   c                C   sX   || _ |ptƒ | _|| _|| _|| _|| _|| _|| _|	| _	|
| _
|| _|| _|| _d S ©N)r   r"   r€   rz   r{   rA   r|   rC   rD   rE   r}   rF   rQ   r~   )rf   r   r€   rz   r{   rA   r|   rC   rD   rE   r}   rF   rQ   r~   r3   r3   r4   Ú__init__ò   s   
zPretty.__init__r@   r'   Úoptionsr(   r,   c              	   c   s¸   � t | j|j| j | j| j| j| j| jd�}t	|| j
p|j
| jp"|jt| j|jƒdd�}|r3|  |¡nt	t| jƒ› d�dd�}| jrM|jsM|j| jdd�}| jrWd|v rWd	V  |V  d S )
N©Ú	max_widthrz   rD   rE   r}   rF   Úpretty)r{   rA   r|   Ústylez.__repr__ returned empty stringz
dim italic)r‡   zrepr.indentÚ
Ú )Úpretty_reprr   r…   rQ   rz   rD   rE   r}   rF   r&   r{   rA   r   r|   r€   r1   rC   Ú
ascii_onlyÚwith_indent_guidesr~   )rf   r@   rƒ   Ú
pretty_strÚpretty_textr3   r3   r4   Ú__rich_console__  s>   €
ù	

û	ÿþýÿ
zPretty.__rich_console__r%   c                 C   sD   t | j|j| j| j| jd�}|rtdd„ | ¡ D ƒƒnd}t||ƒS )N)r…   rz   rD   rE   c                 s   ó   � | ]}t |ƒV  qd S r�   r    ©Ú.0rX   r3   r3   r4   Ú	<genexpr>?  ó   € z*Pretty.__rich_measure__.<locals>.<genexpr>r   )	rŠ   r   r…   rz   rD   rE   ÚmaxÚ
splitlinesr%   )rf   r@   rƒ   r�   Ú
text_widthr3   r3   r4   Ú__rich_measure__4  s   ûÿ
zPretty.__rich_measure__r�   )r@   r'   rƒ   r(   r.   r,   )r@   r'   rƒ   r(   r.   r%   )ri   rj   rk   Ú__doc__r   r   Úintrl   r‚   r�   r˜   r3   r3   r3   r4   rZ   Þ   st    ýñþýûúùø	÷
öõôóòñ
ðÿÿ
þ#ÿÿþrZ   r   c                 C   s   d| j ›d�dd| j ›d�fS )Nzdefaultdict(z, {ú})z, {}))Údefault_factory©r   r3   r3   r4   Ú_get_braces_for_defaultdictD  s   ýrž   z
array[Any]c                 C   s   d| j ›d�ddfS )Nzarray(z, [ú])zarray({_object.typecode!r}))Útypecoder�   r3   r3   r4   Ú_get_braces_for_arrayL  s   r¡   c                 C   ó   dS )N)z	environ({r›   zenviron({})r3   r�   r3   r3   r4   Ú<lambda>Q  ó    r£   c                 C   r¢   )N)z	Counter({r›   z	Counter()r3   r�   r3   r3   r4   r£   T  r¤   c                 C   r¢   )N)zdeque([rŸ   zdeque()r3   r�   r3   r3   r4   r£   U  r¤   c                 C   r¢   ©N)Ú{Ú}z{}r3   r�   r3   r3   r4   r£   V  r¤   c                 C   r¢   r¥   r3   r�   r3   r3   r4   r£   W  r¤   c                 C   r¢   )N)zfrozenset({r›   zfrozenset()r3   r�   r3   r3   r4   r£   X  r¤   c                 C   r¢   ©N)ú[ú]z[]r3   r�   r3   r3   r4   r£   Y  r¤   c                 C   r¢   r¨   r3   r�   r3   r3   r4   r£   Z  r¤   c                 C   r¢   )N)r¦   r§   zset()r3   r�   r3   r3   r4   r£   [  r¤   c                 C   r¢   )N)ú(ú)ú()r3   r�   r3   r3   r4   r£   \  r¤   c                 C   r¢   )N)zmappingproxy({r›   zmappingproxy({})r3   r�   r3   r3   r4   r£   ]  r¤   Ú_BRACESc                 C   s.   t | tƒpt| ƒpt| dƒpt| ƒot| ƒ S )z3Check if an object may be expanded by pretty print.Ú__rich_repr__)rS   Ú_CONTAINERSr
   Úhasattrr5   r   r2   r3   r3   r4   Úis_expandablec  s   
ÿþüûr²   c                	   @   sÞ   e Zd ZU dZdZeed< dZeed< dZeed< dZ	eed< dZ
eed< dZeed	< dZeed
< dZeed   ed< dZdZeed< dee fdd„Zdededefdd„Zdefdd„Z	d dedededefdd„Zd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_tupleNÚchildrenz: z, Ú	separatorr.   c                 c   s¶   � | j r| j V  | jV  | jr| jV  dS | jdurY| jrS| jV  | jr9t| jƒdkr9| jd  ¡ E dH  dV  n| jD ]}| ¡ E dH  |jsL| j	V  q<| j
V  dS | jV  dS dS )zGenerate tokens for this node.Nr   r   ú,)r´   Úkey_separatorrµ   r»   r¶   rº   ÚlenÚiter_tokensr¹   r¼   r·   r¸   )rf   Úchildr3   r3   r4   rÀ   |  s(   €

€ózNode.iter_tokensÚstart_lengthrD   c                 C   s0   |}|   ¡ D ]}|t|ƒ7 }||kr dS qdS )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!   )rf   rÂ   rD   Útotal_lengthÚtokenr3   r3   r4   Úcheck_length’  s   
ÿzNode.check_lengthc                 C   s   d  |  ¡ ¡}|S ©Nr‰   )ÚjoinrÀ   )rf   Ú	repr_textr3   r3   r4   Ú__str__£  s   zNode.__str__éP   ry   r…   rz   rF   c                 C   s‚   t | dd�g}d}|t|ƒk r5|| }|jr+|js+|s | |¡s+| |¡|||d …< |d7 }|t|ƒk sd dd„ |D ƒ¡}|S )al  Render 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_rootr   r   rˆ   c                 s   r�   r�   )Ústrr‘   r3   r3   r4   r“   ½  r”   zNode.render.<locals>.<genexpr>)Ú_Liner¿   Ú
expandableÚexpandedrÅ   ÚexpandrÇ   )rf   r…   rz   rF   ÚlinesÚline_norX   Úrepr_strr3   r3   r4   Úrender§  s   ûzNode.render)rÊ   ry   F)ri   rj   rk   r™   r´   rÍ   rm   rµ   r¶   r·   r¸   r¹   rl   rº   r»   r   r   r¾   r¼   r   rÀ   rš   rÅ   rÉ   rÕ   r3   r3   r3   r4   r³   m  s2   
 ÿÿÿÿþr³   c                   @   sÂ   e Zd ZU dZdZed  ed< dZeed< dZ	ee
 ed< dZeed< dZeed	< dZeed
< dZeed< dZeed< edefdd„ƒZdedefdd„Zdeded  fdd„Zdefdd„ZdS )rÎ   zA line in repr output.NÚparentFrÌ   rË   r‰   ÚtextÚsuffixÚ
whitespacerÐ   r¹   r.   c                 C   s   t | jduo	| jjƒS )z"Check if the line may be expanded.N)rl   rË   r»   ©rf   r3   r3   r4   rÏ   Î  s   z_Line.expandablerD   c                 C   s:   t | jƒt| jƒ t| jƒ }| jdusJ ‚| j ||¡S )z4Check this line fits within a given number of cells.N)r¿   rÙ   r!   r×   rØ   rË   rÅ   )rf   rD   rÂ   r3   r3   r4   rÅ   Ó  s   ÿz_Line.check_lengthrz   c                 c   sÚ   � | j }|dus
J ‚| j}|jsJ ‚|jr&t|j› |j› |j› �|d�V }nt|j|d�V }| jd|  }|jo>t|jƒdk}t	|jƒD ]\}}|rLdn|j
}	t||||	|oX| d�}
|
V  qDt|j|| j| jd�V  dS )z6Expand this line by adding children on their own line.N)r×   rÙ   ú r   r½   )rÖ   rË   rÙ   rØ   r¹   )r×   rÙ   rØ   r¹   )rË   rÙ   r»   r´   rÎ   r¾   r¶   rº   r¿   r   r¼   r·   rØ   r¹   )rf   rz   rË   rÙ   Únew_lineÚchild_whitespaceÚtuple_of_oner¹   rÁ   r¼   rX   r3   r3   r4   rÑ   Û  s:   €

þûüz_Line.expandc                 C   sD   | j r| j› | j› | jpd› �S | j› | j› | jpd› | j ¡ › �S rÆ   )r¹   rÙ   r×   rË   rØ   ÚrstriprÚ   r3   r3   r4   rÉ   ü  s   "ÿz_Line.__str__)ri   rj   rk   r™   rÖ   r   rm   rÌ   rl   rË   r³   r×   rÍ   rØ   rÙ   rÐ   r¹   ÚpropertyrÏ   rš   rÅ   r   rÑ   rÉ   r3   r3   r3   r4   rÎ   Á  s   
 !rÎ   r}   c              	      sd   dt dtf‡fdd„‰tƒ ‰ˆj‰ˆj‰ddt dtdtdtf‡ ‡‡‡‡‡‡fd	d
„‰ ˆ | d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.
    r-   r.   c              
      sŽ   ˆ dur$t | ttfƒr$t| ƒˆ kr$t| ƒˆ  }| dˆ … ›d|› �}|S zt| ƒ}W |S  tyF } zdt|ƒ›d�}W Y d}~|S d}~ww )z0Get repr string for an object, but catch errors.Nú+z<repr-error ú>)rS   ÚbytesrÍ   r¿   re   r<   )r-   Ú	truncatedÚobj_reprÚerror)rE   r3   r4   Úto_repr  s   ÿü
þ€þztraverse.<locals>.to_reprFr   ÚrootÚdepthc           #   	      s°  t ˆƒ}tjjtjjf}ˆduo|ˆk}dtdttttt	tf f  fdd„}zt
ˆdƒ}W n ty9   d}Y nw d}|sWzt
ˆdƒrLtˆƒsLˆ ¡ }W n	 tyV   Y nw |durätˆjd	dƒ}	t||ƒƒ}
ˆjj}|
rÐg }|j}|r|td
d�}�nT|	rŒtd|› d�d||dd�}nt|› d�d||d�}t|
ƒD ]2\}}t|tƒr¾|\}}ˆ||d d�}||_||_d|_||ƒ q›ˆ||d d�}||_||ƒ q›�n t|	rÙd|› d�n|› d�g |d�}�nìtˆƒ�rg|�sgg }|j}tˆƒ‰ ˆ �rY|�rtd
d�}�nÎtˆjj› d�d||d�}dttt	ttttgt	f  f  f‡ ‡fdd„}t|ƒ ƒD ]*\}\}}}|�r@tt	||ƒƒd�}nˆ||d d�}||_||_d|_||ƒ �q,�nwtˆjj› d�g |d�}�nitˆƒ�rÝtˆt ƒ�sÝ|�sÝtˆƒ�s|dk�rÝt ˆƒ}|ˆv �r�td
d�S ˆ|ƒ g }|j}|�r td
d�}�n0tˆjj› d�d||d�}tdd„ t!ˆƒD ƒƒD ]\}}ˆtˆ|j"ƒ|d d�}|j"|_||_d|_||ƒ �q¸ˆ|ƒ nótˆt#ƒ�rÈt#D ]}tˆ|ƒ�rñ|} n�qåt ˆƒ}|ˆv �rtd
d�S ˆ|ƒ t$| ˆƒ\}}}|�rtd
|d�}n«|j%t ˆƒj%k�r*tˆˆƒ|d�}n™ˆ�r¼g }t||||d�}|j}t&ˆƒ}|d }tˆt'ƒ�r{t(ˆ )¡ ƒ} ˆdu�rXt*| ˆƒ} t+| ƒD ]\}!\}}ˆ||d d�}ˆ|ƒ|_|!|k|_||ƒ �q\n)t(ˆƒ}"ˆdu�r‰t*|"ˆƒ}"t+|"ƒD ]\}!}ˆ||d d�}|!|k|_||ƒ �q�ˆdu�r»|ˆk�r»|td|ˆ › �dd�ƒ nt|g |d �}ˆ|ƒ ntˆˆƒ|d�}tˆtƒ|_,|S )!zWalk the object depth first.NÚ	rich_argsr.   c                 s   s„   � | D ]<}t |tƒr<t|ƒdkr |\}}}||krq||fV  qt|ƒdkr0|\}}||fV  qt|ƒdkr;|d V  q|V  qd S )Né   é   r   r   )rS   Útupler¿   )rê   ÚargÚkeyrÁ   Údefaultr3   r3   r4   Úiter_rich_args6  s    €


€óz3traverse.<locals>._traverse.<locals>.iter_rich_argsÚ,awehoi234_wdfjwljet234_234wdfoijsdfmmnxpi492Fr¯   Úangularz...)rµ   ú<rÛ   râ   )r¶   r·   r»   r¹   r¼   r«   r¬   )r¶   r·   r»   r¹   r   )ré   ú=r­   )rµ   r»   r¹   c                  3   sx   � ˆ D ]6} | j r9ztˆ| jƒ}W n ty) } z| j|dfV  W Y d}~qd}~ww | j|t| j ƒr5| j ndfV  qdS )z$Iterate over attr fields and values.N)re   rU   Únamer<   Úcallable)Úattrr?   ræ   ©Úattr_fieldsr-   r3   r4   Ú
iter_attrs’  s   €€þý€øz/traverse.<locals>._traverse.<locals>.iter_attrs)rë   é   c                 s   s   � | ]}|j r|V  qd S r�   )re   )r’   Úfieldr3   r3   r4   r“   Ê  s   € ÿ
ÿz.traverse.<locals>._traverse.<locals>.<genexpr>)rµ   r¹   z... +T)r¸   r»   r¹   )-r1   rt   Úversion_infoÚmajorÚminorr   r   r   r   rÍ   r±   r<   r   r¯   rU   ÚlistÚ	__class__ri   Úappendr³   r   rS   rí   r¹   r´   r¾   r5   r6   r   r   r
   r=   Úidr	   rö   r°   r®   r7   r¿   Ú_MAPPING_CONTAINERSÚiterÚitemsr   Ú	enumeraterº   )#r-   rè   ré   Úobj_typeÚ
py_versionÚreached_max_depthrñ   Úfake_attributesÚrich_repr_resultró   ÚargsÚ
class_namer»   r  rË   r¹   rî   rï   rÁ   Ú
child_noderû   rö   r?   Úrepr_callableÚobj_idrý   Úcontainer_typer¶   r·   r¸   Ú	num_itemsÚlast_item_indexÚ
iter_itemsÚindexÚiter_values)Ú	_traverser}   rD   Úpop_visitedÚpush_visitedrç   Úvisited_idsrù   r4   r  .  sV  &ÿÿ€ÿ
ûü


õ
ýüÿø

ÿÿþýü


üÿ
þ

ü



ü


€
ztraverse.<locals>._traverseT)rè   N)Fr   )r   rÍ   ÚsetÚaddÚremoverl   rš   r³   )r   rD   rE   r}   rË   r3   )r  r}   rD   rE   r  r  rç   r  r4   Útraverse  s   , br   rÊ   ry   r„   r…   rz   c          	      C   s4   t | tƒr| }nt| |||d�}|j|||d�}|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.
    )rD   rE   r}   )r…   rz   rF   )rS   r³   r   rÕ   )	r   r…   rz   rD   rE   r}   rF   rË   rÔ   r3   r3   r4   rŠ     s   
ÿÿrŠ   T)r@   rC   rD   rE   r}   rF   c             
   C   s6   |du rt ƒ n|}|jt| |||||dd�dd� dS )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.
    Nr>   )rD   rE   r}   rC   rF   rA   T)Ú	soft_wrap)r   rY   rZ   )r   r@   rC   rD   rE   r}   rF   Ú_consoler3   r3   r4   rd   ;  s   ù	
örd   Ú__main__c                   @   s   e Zd Zdefdd„ZdS )Ú
BrokenReprr.   c                 C   s   dd  dS )Nr   r   zthis will failr3   rÚ   r3   r3   r4   r7   c  s   zBrokenRepr.__repr__N)ri   rj   rk   rÍ   r7   r3   r3   r3   r4   r$  b  s    r$  é   ÚfoozHello World!gZd;ßY@gÁÊ¡E¶3t@g    cA>   ©r   rì   rë   ry   r%  rü   é   é   >   r   rì   rë   Úcrumble)ÚappleÚrhubarbÚbutterÚsugarÚflour)r+  ÚorangeÚpearÚkumquatr2  ÁX  duriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTN)r&  Úbarr   ÚcounterÚatomicÚBroken)rY   é   )rC   rE   )Nr>   FFNNF)NNN)er`   r:   rV   ÚosÚrert   r   Úcollectionsr   r   r   r   r   r   r	   r
   r   Ú	itertoolsr   Útypesr   Útypingr   r   r   r   r   r   r   r   r   r   r   Úpip._vendor.rich.reprr   rø   r/   ÚImportErrorr‰   r   Ú_loopr   Ú_pickr   Úabcr   Úcellsr!   r€   r"   Újupyterr#   r$   Úmeasurer%   r×   r&   r@   r'   r(   r)   r*   r+   r,   rl   r5   r6   Úobjectr=   rš   r_   rx   rZ   rÍ   rž   r¡   Ú_EnvironÚdictÚ	frozensetr  r  rí   r®   r1   rm   Úkeysr°   r  r²   r³   rÎ   r   rŠ   rd   ri   r$  ÚdÚdatar  ro   rY   r3   r3   r3   r4   Ú<module>   s„  
 4ÿ 
øÿþýüûúùø	
÷Aùÿþýüûúù
øK$f
(ó
SEüÿþýü
û  øÿýüûúùø	
÷+øÿýüûúùø	
÷
%ú
ÿÿ
èÙ