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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 m!Z!m"Z" d d	l#m$Z$ zd dl%Z&e'e&d
ƒZ(W n e)y‡   dZ(Y nw ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7m8Z8 ddl9m:Z: ddl;m<Z< erÒddl=m>Z>m?Z?m@Z@mAZAmBZBmCZC dedeDfdd„ZEdeded fdd„ZFdeGdeDfdd„ZHe Id g ¡ZJdeGdeDfd!d"„ZK		#						d€d$ed%ed& d'd(d)eDd*eDd+eeL d,eeL d-eeL d.eDde"eMdf fd/d0„ZNdeGd1e"eOe!eOd2f f deDfd3d4„ZP		#						d€d%ed& d'd(d)eDd*eDd+eeL d,eeL d-eeL d.eDddfd5d6„ZQG d7d8„ d8e7ƒZRd9eeef de!eMeMeMf fd:d;„ZSd9ee de!eMeMeMf fd<d=„ZTd9d>de!eMeMeMf fd?d@„ZUejVdAdB„ eeUeeSedCdB„ eeTeWdDdB„ e	dEdB„ eXdFdB„ eYdGdB„ e
dHdB„ eZdIdB„ e[dJdB„ edKdB„ iZ\eeOeege!eMeMeMf f f e]dL< e[e\ ^¡ ƒZ_eWejVee	fZ`dedeDfdMdN„ZaeG dOdP„ dPƒƒZbeG dQdR„ dRƒƒZcdedeDfdSdT„Zd			d�d9ed+eeL d,eeL d-eeL debf
dUdV„ZedWdXdddddYœd9edZeLd[eLd+eeL d,eeL d-eeL d.eDdeMfd\d]„Zfdd^ddddd_œd9ed%ed& d*eDd+eeL d,eeL d-eeL d.eDddfd`da„Zgehdbk�ræG dcdd„ ddƒZid delmjZj G dfdg„ dgejƒZkeeLƒZldheldi< ddjdkdldmh dn£geXh do£ƒeeYdpg dq¢iƒeg dr¢ƒdsekdtdudvdwdxdygƒeiƒ dzœZmemdi  nem¡ d d{lompZp epeRemd^d|d}�ƒ G d~d„ dƒZqepeReqƒ ƒƒ dS dS )‚é    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                 C   s   t ot t| ƒ¡S )z1Check if an object was created with attrs module.)Ú
_has_attrsÚ_attr_moduleÚhasÚtype©r0   © r7   úT/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pip/_vendor/rich/pretty.pyÚ_is_attr_object<   s   r9   z_attr_module.Attribute[Any]c                 C   s   t r	t t| ƒ¡S g S )zGet fields for an attrs object.)r2   r3   r	   r5   r6   r7   r7   r8   Ú_get_attr_fieldsA   s   r:   c                 C   s.   z| j jjtjtjfv 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__ÚreprlibÚ	Exceptionr6   r7   r7   r8   Ú_is_dataclass_reprF   s   þÿrB   Ú_dummy_namedtuplec              	   C   s@   d}zt  | j¡}W n ttfy   Y nw t  tj¡}||kS )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Ú	TypeErrorrC   )r0   Úobj_fileÚdefault_repr_filer7   r7   r8   Ú_has_default_namedtuple_repr]   s   	ýrJ   ÚignoreÚvalueÚconsoler*   Úoverflowr.   ÚcropÚindent_guidesÚ
max_lengthÚ
max_stringÚ	max_depthÚ
expand_allc	                 C   s¨   ddl m}	 t| tƒs| d u rd S |ptƒ }| ¡ �+}
t| |	ƒr$| ¡  |jt| tƒr-| nt	| ||||||dd�|ddd� W d   ƒ n1 sHw   Y  |
 
¡  d¡S )	Nr   )ÚConsoleRenderableé   )rN   rP   rQ   rR   rS   rT   ÚmarginTÚ )rO   Únew_line_startÚendÚ
)rM   rU   Ú_safe_isinstancer'   r   ÚcaptureÚlineÚprintr"   ÚPrettyÚgetÚrstrip)rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   r]   r7   r7   r8   Ú_ipy_display_hookq   s4   


ÿøïürc   Úclass_or_tuple.c                 C   s"   zt | |ƒW S  ty   Y dS w )zFisinstance can fail in rare cases, for example types with no __class__F)Ú
isinstancerA   )r0   rd   r7   r7   r8   r\   ¡   s
   ÿr\   c              	      s®   ddl m‰ ˆ p
ˆƒ ‰ ˆ dusJ ‚dtddf‡ ‡‡‡‡‡‡‡fdd„}ztƒ }	W n ty5   |t_Y dS w ddlm}
 G ‡‡‡‡‡‡‡fd	d
„d
|
ƒ}|ƒ }||	j	j
d< dS )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.
    r   r   NrL   r1   c              
      sV   | 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)rN   rP   rQ   rR   rS   rT   )rO   )ÚbuiltinsÚ_r_   r\   r"   r`   )rL   )rM   rO   rT   rP   rS   rQ   rR   rN   r7   r8   Ú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ÚpprintrL   r1   c              
      s(   | j rt|ˆƒ ˆˆˆˆˆˆ d�S t|ƒS )N)rM   rN   rP   rQ   rR   rS   rT   )rj   rc   Úrepr)ÚselfrL   ©rT   r   rP   rS   rQ   rR   rN   r7   r8   Ú__call__é   s   øz'install.<locals>.RichFormatter.__call__N)Ú__name__Ú
__module__Ú__qualname__rj   ÚboolÚ__annotations__r   rn   r7   rm   r7   r8   ÚRichFormatteræ   s   
 &rt   z
text/plain)Úpip._vendor.richr   r   Úget_ipythonÚ	NameErrorÚsysÚdisplayhookÚIPython.core.formattersri   Údisplay_formatterÚ
formatters)rM   rN   rO   rP   rQ   rR   rS   rT   rh   Úipri   rt   Úrich_formatterr7   )	rM   rO   rT   r   rP   rS   rQ   rR   rN   r8   Úinstall«   s   
$
ÿ r   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 )'r`   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ÚjustifyrN   Úno_wraprP   rQ   rR   rS   rT   rW   Úinsert_lineÚ_objectÚhighlighterr,   r�   r‚   r-   rN   r.   rƒ   rP   rQ   rR   rS   rT   rW   r„   r1   c                C   sX   || _ |ptƒ | _|| _|| _|| _|| _|| _|| _|	| _	|
| _
|| _|| _|| _d S ©N)r…   r%   r†   r�   r‚   rN   rƒ   rP   rQ   rR   rS   rT   rW   r„   )rl   r…   r†   r�   r‚   rN   rƒ   rP   rQ   rR   rS   rT   rW   r„   r7   r7   r8   Ú__init__  s   
zPretty.__init__rM   r*   Úoptionsr+   r/   c              	   c   sº   � t | j|j| j | j| j| j| j| jd�}t	j
|| jp|j| jp#|jt| j|jƒdd�}|r4|  |¡nt	t| jƒ› d�dd�}| jrN|jsN|j| jdd�}| jrXd|v rXd	V  |V  d S )
N©Ú	max_widthr�   rQ   rR   rS   rT   Úpretty)r‚   rN   rƒ   Ústylez.__repr__ returned empty stringz
dim italic)r�   zrepr.indentr[   rX   )Úpretty_reprr…   r‹   rW   r�   rQ   rR   rS   rT   r)   Ú	from_ansir‚   rN   r!   rƒ   r†   r5   rP   Ú
ascii_onlyÚwith_indent_guidesr„   )rl   rM   r‰   Ú
pretty_strÚpretty_textr7   r7   r8   Ú__rich_console__0  s>   €
ù	

û	ÿþýÿ
zPretty.__rich_console__r(   c              	   C   sL   t | j|j| j| j| j| j| jd�}|rtdd„ | 	¡ D ƒƒnd}t
||ƒS )NrŠ   c                 s   ó   � | ]}t |ƒV  qd S r‡   r#   ©Ú.0r^   r7   r7   r8   Ú	<genexpr>`  ó   € z*Pretty.__rich_measure__.<locals>.<genexpr>r   )rŽ   r…   r‹   r�   rQ   rR   rS   rT   ÚmaxÚ
splitlinesr(   )rl   rM   r‰   r’   Ú
text_widthr7   r7   r8   Ú__rich_measure__S  s   ù
ÿ
zPretty.__rich_measure__r‡   )rM   r*   r‰   r+   r1   r/   )rM   r*   r‰   r+   r1   r(   )ro   rp   rq   Ú__doc__r   r   Úintrr   rˆ   r”   r�   r7   r7   r7   r8   r`   ý   st    ýñþýûúùø	÷
öõôóòñ
ðÿÿ
þ#ÿÿþr`   r…   c                 C   ó   d| j ›d�dd| j ›d�fS )Nzdefaultdict(z, {ú})z, {}))Údefault_factory©r…   r7   r7   r8   Ú_get_braces_for_defaultdicte  s   ýr¤   c                 C   s,   | j d u rdS dd| j › d�d| j › d�fS )N)údeque([ú])zdeque()r¥   z
], maxlen=ú)zdeque(maxlen=)Úmaxlenr£   r7   r7   r8   Ú_get_braces_for_dequem  s   
ýr©   z
array[Any]c                 C   r    )Nzarray(z, [r¦   r§   )Útypecoder£   r7   r7   r8   Ú_get_braces_for_arrayw  s   r«   c                 C   ó   dS )N)z	environ({r¡   zenviron({})r7   r£   r7   r7   r8   Ú<lambda>|  ó    r­   c                 C   r¬   )N)z	Counter({r¡   z	Counter()r7   r£   r7   r7   r8   r­     r®   c                 C   r¬   ©N)Ú{Ú}z{}r7   r£   r7   r7   r8   r­   �  r®   c                 C   r¬   r¯   r7   r£   r7   r7   r8   r­   ‚  r®   c                 C   r¬   )N)zfrozenset({r¡   zfrozenset()r7   r£   r7   r7   r8   r­   ƒ  r®   c                 C   r¬   ©N)ú[ú]z[]r7   r£   r7   r7   r8   r­   „  r®   c                 C   r¬   r²   r7   r£   r7   r7   r8   r­   …  r®   c                 C   r¬   )N)r°   r±   zset()r7   r£   r7   r7   r8   r­   †  r®   c                 C   r¬   )N)ú(r§   ú()r7   r£   r7   r7   r8   r­   ‡  r®   c                 C   r¬   )N)zmappingproxy({r¡   zmappingproxy({})r7   r£   r7   r7   r8   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__)r\   Ú_CONTAINERSr
   Úhasattrr9   r   r6   r7   r7   r8   Úis_expandableŽ  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< dZeed   ed< dZeed< 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.rX   Úkey_reprÚ
value_reprÚ
open_braceÚclose_braceÚemptyFÚlastÚis_tupleÚis_namedtupleNÚchildrenz: Úkey_separatorz, Ú	separatorr1   c                 c   s¼   � | j r| j V  | jV  | jr| jV  dS | jdur\| jrV| jV  | jr<| js<t| jƒdkr<| jd  ¡ E dH  dV  n| jD ]}| ¡ E dH  |j	sO| j
V  q?| jV  dS | jV  dS dS )zGenerate tokens for this node.Nr   r   ú,)r½   rÆ   r¾   rÅ   r¿   rÃ   rÄ   ÚlenÚiter_tokensrÂ   rÇ   rÀ   rÁ   )rl   Úchildr7   r7   r8   rÊ   ¨  s(   €

€ózNode.iter_tokensÚstart_lengthrQ   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$   )rl   rÌ   rQ   Útotal_lengthÚtokenr7   r7   r8   Úcheck_length¾  s   
ÿzNode.check_lengthc                 C   s   d  |  ¡ ¡}|S ©NrX   )ÚjoinrÊ   )rl   Ú	repr_textr7   r7   r8   Ú__str__Ï  s   zNode.__str__éP   r€   r‹   r�   rT   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–   r7   r7   r8   r˜   é  r™   zNode.render.<locals>.<genexpr>)Ú_LinerÉ   Ú
expandableÚexpandedrÏ   ÚexpandrÑ   )rl   r‹   r�   rT   ÚlinesÚline_nor^   Úrepr_strr7   r7   r8   ÚrenderÓ  s   ûzNode.render)rÔ   r€   F)ro   rp   rq   rž   r½   r×   rs   r¾   r¿   rÀ   rÁ   rÂ   rr   rÃ   rÄ   rÅ   r   r   rÆ   rÇ   r   rÊ   rŸ   rÏ   rÓ   rß   r7   r7   r7   r8   r¼   ˜  s4   
 ÿÿÿÿþ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Õ   rX   ÚtextÚsuffixÚ
whitespacerÚ   rÂ   r1   c                 C   s   t | jduo	| jjƒS )z"Check if the line may be expanded.N)rr   rÕ   rÅ   ©rl   r7   r7   r8   rÙ   ú  s   z_Line.expandablerQ   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Ï   )rl   rQ   rÌ   r7   r7   r8   rÏ   ÿ  s   ÿz_Line.check_lengthr�   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Â   )rl   r�   rÕ   rã   Únew_lineÚchild_whitespaceÚtuple_of_onerÂ   rË   rÇ   r^   r7   r7   r8   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â   rb   rä   r7   r7   r8   rÓ   (  s   "ÿz_Line.__str__)ro   rp   rq   rž   rà   r   rs   rÖ   rr   rÕ   r¼   rá   r×   râ   rã   rÚ   rÂ   ÚpropertyrÙ   rŸ   rÏ   r   rÛ   rÓ   r7   r7   r7   r8   rØ   í  s   
 !rØ   c                 C   s:   zt | ddƒ}W n
 ty   Y dS w t| tƒot|tƒS )aX  Checks 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)ÚgetattrrA   re   Útuple)r0   r	   r7   r7   r8   Ú_is_namedtuple1  s   þ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.
    r0   r1   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 ú>)r\   Úbytesr×   rÉ   rk   rA   )r0   Ú	truncatedÚobj_reprÚerror)rR   r7   r8   Úto_reprY  s   ÿü
þ€þztraverse.<locals>.to_reprFr   ÚrootÚdepthc           "   	      sœ  t ˆƒ}|ˆv rtdd�S tˆƒ}ˆduo|ˆk}dtdttttttf f  fdd„}ztˆdƒ}W n t	y>   d	}Y nw d}|s\ztˆd
ƒrQt
ˆƒsQˆ ¡ }W n	 t	y[   Y nw |durþˆ|ƒ tˆjdd	ƒ}	t||ƒƒ}
ˆjj}|
ræg }|j}|r“|	rŠtd|› d�d�}nnt|› d�d�}ne|	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�}ˆ|ƒ �nBtˆƒ�rŒ|�sŒˆ|ƒ g }|j}tˆƒ‰ ˆ �rz|�r$tˆjj› d�d�}nbtˆjj› d�d||d�}dtttttttgtf  f  f‡ ‡fdd„}t|ƒ ƒD ]*\}\}}}|�rbtt||ƒƒd�}nˆ||d d�}||_||_d|_||ƒ �qNntˆjj› d�g |d�}ˆ|ƒ �n´tˆƒ�rütˆtƒ�sü|�sütˆƒ�rüˆ|ƒ g }|j}|�r¶tˆjj› d�d�}n@tˆjj› d�d||ˆjj› d�d�}t‡fdd„tˆƒD ƒƒD ]\}}ˆtˆ|jƒ|d d�}|j|_||_d|_||ƒ �qÖˆ|ƒ �nDtˆƒ�rWt ˆƒ�rWˆ|ƒ ˆjj}|�rt|› d�d�}n8g }|j}t|› d�d||› d�d�}tˆ !¡  "¡ ƒD ]\}\}}ˆ||d d�}||_||_d|_||ƒ �q5ˆ|ƒ nétˆt#ƒ�r8t#D ]}tˆ|ƒ�rk|} n�q_ˆ|ƒ 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�rÈt)|ˆƒ}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k|_+tˆƒ|_,|S )$zWalk the object depth first.z...)r¾   NÚ	rich_argsr1   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   )r\   rì   rÉ   )r÷   ÚargÚkeyrË   Údefaultr7   r7   r8   Úiter_rich_argsy  s    €


€óz3traverse.<locals>._traverse.<locals>.iter_rich_argsÚ,awehoi234_wdfjwljet234_234wdfoijsdfmmnxpi492Fr¸   Úangularú<z...>z(...)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)rk   rë   ÚnamerA   Úcallable)ÚattrrL   ró   ©Úattr_fieldsr0   r7   r8   Ú
iter_attrsÛ  s   €€þý€øz/traverse.<locals>._traverse.<locals>.iter_attrs)r¿   rÀ   rÅ   rÂ   rÁ   c                 3   s&   � | ]}|j rtˆ |jƒr|V  qd S r‡   )rk   rº   r  )r—   Úfieldr6   r7   r8   r˜     s   € ý
ý
ÿz.traverse.<locals>._traverse.<locals>.<genexpr>)r¿   rÀ   rÅ   rÁ   )r¾   rÂ   z... +T)rÁ   rÅ   rÂ   )-Úidr¼   r5   r   r   r   r   r×   rº   rA   r   r¸   rë   ÚlistÚ	__class__ro   Úappendr    r\   rì   rÂ   r½   rÆ   r9   r:   r   r   r
   rB   r	   r  rí   rJ   Ú_asdictÚitemsr¹   r·   r;   rÉ   Ú_MAPPING_CONTAINERSÚiterr   Ú	enumeraterÃ   rÄ   )"r0   rõ   rö   Úobj_idÚobj_typeÚreached_max_depthrý   Úfake_attributesÚrich_repr_resultrÿ   ÚargsÚ
class_namerÅ   r  rÕ   rÂ   rú   rû   rË   Ú
child_noder  r  rL   Úrepr_callabler  Úcontainer_typer¿   rÀ   rÁ   Ú	num_itemsÚlast_item_indexÚ
iter_itemsÚindexÚiter_values)Ú	_traverserS   rQ   Úpop_visitedÚpush_visitedrô   Úvisited_idsr  r8   r!  m  sˆ  
&ÿÿ€ÿ
ûü


õýüÿø
ÿÿþýüûþÿü
þü



ü


€

ztraverse.<locals>._traverseT)rõ   N)Fr   )r   r×   ÚsetÚaddÚremoverr   rŸ   r¼   )r…   rQ   rR   rS   rÕ   r7   )r!  rS   rQ   rR   r"  r#  rô   r$  r8   ÚtraverseD  s   , ~r(  rÔ   r€   rŠ   r‹   r�   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.
    )rQ   rR   rS   )r‹   r�   rT   )r\   r¼   r(  rß   )	r…   r‹   r�   rQ   rR   rS   rT   rÕ   rÞ   r7   r7   r8   rŽ   n  s   
ÿÿrŽ   T)rM   rP   rQ   rR   rS   rT   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.
    NrK   )rQ   rR   rS   rP   rT   rN   T)Ú	soft_wrap)r   r_   r`   )r…   rM   rP   rQ   rR   rS   rT   Ú_consoler7   r7   r8   rj   –  s   ù	
örj   Ú__main__c                   @   ó   e Zd Zdefdd„ZdS )Ú
BrokenReprr1   c                 C   s   dd  dS )Nr   r   zthis will failr7   rä   r7   r7   r8   r;   ¾  s   zBrokenRepr.__repr__N©ro   rp   rq   r×   r;   r7   r7   r7   r8   r-  ½  ó    r-  )Ú
NamedTuplec                   @   s:   e Zd ZU eed< eed< eed< eed< ee ed< dS )ÚStockKeepingUnitr  ÚdescriptionÚpriceÚcategoryÚreviewsN)ro   rp   rq   r×   rs   Úfloatr   r7   r7   r7   r8   r1  Ä  s   
 r1  é   ÚfoozHello World!gZd;ßY@gÁÊ¡E¶3t@g    cA>   ©r   rù   rø   r€   r7  é   é   é   >   r   rù   rø   Úcrumble)ÚappleÚrhubarbÚbutterÚsugarÚflour)r>  ÚorangeÚpearÚkumquatrE  ÁX  duriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTNzSparkling British Spring WaterzCarbonated spring watergÍÌÌÌÌÌì?Úwaterzits amazing!zits terrible!)r8  Úbarr   ÚcounterÚatomicÚ
namedtupleÚBroken)r_   é   )rP   rR   c                   @   r,  )ÚThingr1   c                 C   r¬   )NzHello[38;5;239m World!r7   rä   r7   r7   r8   r;   õ  s   zThing.__repr__Nr.  r7   r7   r7   r8   rN  ô  r/  rN  )NrK   FFNNNF)NNN)rrf   Úcollectionsr>   rD   Úosr@   rx   r   r   r   r   r   r   r   r	   r
   r   Ú	itertoolsr   Útypesr   Útypingr   r   r   r   r   r   r   r   r   r   r   r   r   Úpip._vendor.rich.reprr   r  r3   rº   r2   ÚImportErrorrX   r   Ú_loopr    Ú_pickr!   Úabcr"   Úcellsr$   r†   r%   Újupyterr&   r'   Úmeasurer(   rá   r)   rM   r*   r+   r,   r-   r.   r/   rr   r9   r:   ÚobjectrB   rK  rC   rJ   rŸ   r×   rc   r5   r\   r   r`   r¤   r©   r«   Ú_EnvironÚdictÚ	frozensetr
  r%  rì   r·   rs   Úkeysr¹   r  r»   r¼   rØ   rí   r(  rŽ   rj   ro   r-  r0  r1  ÚdÚdatar  ru   r_   rN  r7   r7   r7   r8   Ú<module>   sÀ  
 <ÿ 
÷ÿþýüûúùø	÷


ö0ÿÿ
þøÿþýüûúùø	
÷R$h 

(ó
TCüÿþýü
û  /øÿýüûúùø	
÷+øÿýüûúùø	
÷
%ú
ÿÿ
ûá!Ã