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)ÚRichReprResultZ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_moduleZhasÚtype©r/   © r5   úR/var/www/html/chatgpt/venv/lib/python3.10/site-packages/pip/_vendor/rich/pretty.pyÚ_is_attr_object<   s   r7   z_attr_module.Attribute[Any]c                 C   s   t r	t t| ƒ¡S g S )zGet fields for an attrs object.)r1   r2   r	   r3   r4   r5   r5   r6   Ú_get_attr_fieldsA   s   r8   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Ú	Exceptionr4   r5   r5   r6   Ú_is_dataclass_reprF   s   þÿr@   Ú_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Úgetfiler9   ÚOSErrorÚ	TypeErrorrA   )r/   Zobj_fileZdefault_repr_filer5   r5   r6   Ú_has_default_namedtuple_repr]   s   	ýrF   Ú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é   )rJ   rL   rM   rN   rO   rP   ÚmarginTÚ )rK   Únew_line_startÚendÚ
)rI   rQ   Ú_safe_isinstancer&   r   ÚcaptureÚlineÚprintr!   ÚPrettyÚgetÚrstrip)rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rY   r5   r5   r6   Ú_ipy_display_hookq   s4   


ÿøïür_   Ú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)Ú
isinstancer?   )r/   r`   r5   r5   r6   rX   ¡   s
   ÿrX   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   NrH   r0   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)rJ   rL   rM   rN   rO   rP   )rK   )ÚbuiltinsÚ_r[   rX   r!   r\   )rH   )rI   rK   rP   rL   rO   rM   rN   rJ   r5   r6   Ú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ÚpprintrH   r0   c              
      s(   | j rt|ˆƒ ˆˆˆˆˆˆ d�S t|ƒS )N)rI   rJ   rL   rM   rN   rO   rP   )rf   r_   Úrepr)ÚselfrH   ©rP   r   rL   rO   rM   rN   rJ   r5   r6   Ú__call__é   s   øz'install.<locals>.RichFormatter.__call__N)Ú__name__Ú
__module__Ú__qualname__rf   ÚboolÚ__annotations__r   rj   r5   ri   r5   r6   ÚRichFormatteræ   s   
 &rp   z
text/plain)Úpip._vendor.richr   r   Úget_ipythonÚ	NameErrorÚsysÚdisplayhookZIPython.core.formattersre   Zdisplay_formatterZ
formatters)rI   rJ   rK   rL   rM   rN   rO   rP   rd   Úipre   rp   Zrich_formatterr5   )	rI   rK   rP   r   rL   rO   rM   rN   rJ   r6   Úinstall«   s   
$
ÿ rw   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ÚjustifyrJ   Úno_wraprL   rM   rN   rO   rP   rS   Úinsert_lineÚ_objectÚhighlighterr+   ry   rz   r,   rJ   r-   r{   rL   rM   rN   rO   rP   rS   r|   r0   c                C   sX   || _ |ptƒ | _|| _|| _|| _|| _|| _|| _|	| _	|
| _
|| _|| _|| _d S ©N)r}   r$   r~   ry   rz   rJ   r{   rL   rM   rN   rO   rP   rS   r|   )rh   r}   r~   ry   rz   rJ   r{   rL   rM   rN   rO   rP   rS   r|   r5   r5   r6   Ú__init__  s   
zPretty.__init__rI   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_widthry   rM   rN   rO   rP   Úpretty)rz   rJ   r{   Ústylez.__repr__ returned empty stringz
dim italic)r…   zrepr.indentrW   rT   )Úpretty_reprr}   rƒ   rS   ry   rM   rN   rO   rP   r(   Ú	from_ansirz   rJ   r    r{   r~   r3   rL   Ú
ascii_onlyÚwith_indent_guidesr|   )rh   rI   r�   Ú
pretty_strZpretty_textr5   r5   r6   Ú__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"   ©Ú.0rZ   r5   r5   r6   Ú	<genexpr>`  ó   € z*Pretty.__rich_measure__.<locals>.<genexpr>r   )r†   r}   rƒ   ry   rM   rN   rO   rP   ÚmaxÚ
splitlinesr'   )rh   rI   r�   rŠ   Ú
text_widthr5   r5   r6   Ú__rich_measure__S  s   ù
ÿ
zPretty.__rich_measure__r   )rI   r)   r�   r*   r0   r.   )rI   r)   r�   r*   r0   r'   )rk   rl   rm   Ú__doc__r   r   Úintrn   r€   r‹   r”   r5   r5   r5   r6   r\   ý   st    ýñþýûúùø	÷
öõôóòñ
ðÿÿ
þ#ÿÿþr\   r}   c                 C   ó   d| j ›d�dd| j ›d�fS )Nzdefaultdict(z, {ú})z, {}))Údefault_factory©r}   r5   r5   r6   Ú_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š   r5   r5   r6   Ú_get_braces_for_dequem  s   
ýr    z
array[Any]c                 C   r—   )Nzarray(z, [r�   rž   )Útypecoderš   r5   r5   r6   Ú_get_braces_for_arrayw  s   r¢   c                 C   ó   dS )N)z	environ({r˜   zenviron({})r5   rš   r5   r5   r6   Ú<lambda>|  ó    r¤   c                 C   r£   )N)z	Counter({r˜   z	Counter()r5   rš   r5   r5   r6   r¤     r¥   c                 C   r£   ©N)Ú{Ú}z{}r5   rš   r5   r5   r6   r¤   �  r¥   c                 C   r£   r¦   r5   rš   r5   r5   r6   r¤   ‚  r¥   c                 C   r£   )N)zfrozenset({r˜   zfrozenset()r5   rš   r5   r5   r6   r¤   ƒ  r¥   c                 C   r£   ©N)ú[ú]z[]r5   rš   r5   r5   r6   r¤   „  r¥   c                 C   r£   r©   r5   rš   r5   r5   r6   r¤   …  r¥   c                 C   r£   )N)r§   r¨   zset()r5   rš   r5   r5   r6   r¤   †  r¥   c                 C   r£   )N)ú(rž   ú()r5   rš   r5   r5   r6   r¤   ‡  r¥   c                 C   r£   )N)zmappingproxy({r˜   zmappingproxy({})r5   rš   r5   r5   r6   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__)rX   Ú_CONTAINERSr
   Úhasattrr7   r   r4   r5   r5   r6   Ú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.rT   Úkey_reprÚ
value_reprÚ
open_braceÚclose_braceÚemptyFÚlastÚis_tupleÚis_namedtupleNÚchildrenz: Úkey_separatorz, Ú	separatorr0   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¸   )rh   Úchildr5   r5   r6   rÁ   ¨  s(   €

€ózNode.iter_tokensÚstart_lengthrM   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#   )rh   rÃ   rM   Ztotal_lengthÚtokenr5   r5   r6   Úcheck_length¾  s   
ÿzNode.check_lengthc                 C   s   d  |  ¡ ¡}|S ©NrT   )ÚjoinrÁ   )rh   Z	repr_textr5   r5   r6   Ú__str__Ï  s   zNode.__str__éP   rx   rƒ   ry   rP   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   rW   c                 s   rŒ   r   )Ústrr�   r5   r5   r6   r�   é  r�   zNode.render.<locals>.<genexpr>)Ú_LinerÀ   Ú
expandableÚexpandedrÅ   ÚexpandrÇ   )rh   rƒ   ry   rP   ÚlinesÚline_norZ   Úrepr_strr5   r5   r6   ÚrenderÓ  s   ûzNode.render)rÉ   rx   F)rk   rl   rm   r•   r´   rÌ   ro   rµ   r¶   r·   r¸   r¹   rn   rº   r»   r¼   r   r   r½   r¾   r   rÁ   r–   rÅ   rÈ   rÔ   r5   r5   r5   r6   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Ê   rT   ÚtextÚsuffixÚ
whitespacerÏ   r¹   r0   c                 C   s   t | jduo	| jjƒS )z"Check if the line may be expanded.N)rn   rÊ   r¼   ©rh   r5   r5   r6   rÎ   ú  s   z_Line.expandablerM   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Å   )rh   rM   rÃ   r5   r5   r6   rÅ   ÿ  s   ÿz_Line.check_lengthry   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¹   )rh   ry   rÊ   rØ   Únew_lineZchild_whitespaceZtuple_of_oner¹   rÂ   r¾   rZ   r5   r5   r6   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×   r^   rÙ   r5   r5   r6   rÈ   (  s   "ÿz_Line.__str__)rk   rl   rm   r•   rÕ   r   ro   rË   rn   rÊ   r³   rÖ   rÌ   r×   rØ   rÏ   r¹   ÚpropertyrÎ   r–   rÅ   r   rÐ   rÈ   r5   r5   r5   r6   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)Úgetattrr?   ra   Útuple)r/   r	   r5   r5   r6   Ú_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.
    r/   r0   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 ú>)rX   ÚbytesrÌ   rÀ   rg   r?   )r/   Z	truncatedÚobj_reprÚerror)rN   r5   r6   Ú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_argsr0   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   )rX   rß   rÀ   )ré   ÚargÚkeyrÂ   Údefaultr5   r5   r6   Úiter_rich_argsy  s    €


€óz3traverse.<locals>._traverse.<locals>.iter_rich_argsZ,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)rg   rÞ   Únamer?   Úcallable)ÚattrrH   rå   ©Zattr_fieldsr/   r5   r6   Ú
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   )rg   r±   ró   )rŽ   Úfieldr4   r5   r6   r�     s   € ý
ý
ÿz.traverse.<locals>._traverse.<locals>.<genexpr>)r¶   r·   r¼   r¸   )rµ   r¹   z... +T)r¸   r¼   r¹   )-Úidr³   r3   r   r   r   r   rÌ   r±   r?   r   r¯   rÞ   ÚlistÚ	__class__rk   Úappendr   rX   rß   r¹   r´   r½   r7   r8   r   r   r
   r@   r	   ró   rà   rF   Ú_asdictÚitemsr°   r®   r9   rÀ   Ú_MAPPING_CONTAINERSÚiterr   Ú	enumeraterº   r»   )"r/   rç   rè   Zobj_idZobj_typeZreached_max_depthrï   Zfake_attributesZrich_repr_resultrð   ÚargsÚ
class_namer¼   rü   rÊ   r¹   rì   rí   rÂ   Z
child_noder÷   ró   rH   Zrepr_callablerø   Zcontainer_typer¶   r·   r¸   Z	num_itemsZlast_item_indexZ
iter_itemsÚindexÚiter_values)Ú	_traverserO   rM   Úpop_visitedÚpush_visitedræ   Úvisited_idsrö   r6   r  m  sˆ  
&ÿÿ€ÿ
ûü


õýüÿø
ÿÿþýüûþÿü
þü



ü


€

ztraverse.<locals>._traverseT)rç   N)Fr   )r   rÌ   ÚsetÚaddÚremovern   r–   r³   )r}   rM   rN   rO   rÊ   r5   )r  rO   rM   rN   r  r  ræ   r	  r6   ÚtraverseD  s   , ~r  rÉ   rx   r‚   rƒ   ry   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.
    )rM   rN   rO   )rƒ   ry   rP   )rX   r³   r  rÔ   )	r}   rƒ   ry   rM   rN   rO   rP   rÊ   rÓ   r5   r5   r6   r†   n  s   
ÿÿr†   T)rI   rL   rM   rN   rO   rP   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.
    NrG   )rM   rN   rO   rL   rP   rJ   T)Ú	soft_wrap)r   r[   r\   )r}   rI   rL   rM   rN   rO   rP   Ú_consoler5   r5   r6   rf   –  s   ù	
örf   Ú__main__c                   @   ó   e Zd Zdefdd„ZdS )Ú
BrokenReprr0   c                 C   s   dd  dS )Nr   r   zthis will failr5   rÙ   r5   r5   r6   r9   ¾  s   zBrokenRepr.__repr__N©rk   rl   rm   rÌ   r9   r5   r5   r5   r6   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ó   ÚdescriptionZpriceÚcategoryZreviewsN)rk   rl   rm   rÌ   ro   Úfloatr   r5   r5   r5   r6   r  Ä  s   
 r  é   ÚfoozHello World!gZd;ßY@gÁÊ¡E¶3t@g    cA>   r  é   é   é   )r   rë   rê   rx   >   r   rë   rê   Zcrumble)ÚappleZrhubarbÚbutterZsugarZflour)r  ZorangeÚpearÚkumquatr"  AX  duriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTNzSparkling British Spring WaterzCarbonated spring watergÍÌÌÌÌÌì?Zwaterzits amazing!zits terrible!)r  Zbarr   ZcounterZatomicÚ
namedtupleZBroken)r[   é   )rL   rN   c                   @   r  )ÚThingr0   c                 C   r£   )NzHello[38;5;239m World!r5   rÙ   r5   r5   r6   r9   õ  s   zThing.__repr__Nr  r5   r5   r5   r6   r%  ô  r  r%  )NrG   FFNNNF)NNN)rrb   Úcollectionsr<   rB   Úosr>   rt   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   Zpip._vendor.rich.reprr   rõ   r2   r±   r1   ÚImportErrorrT   r   Ú_loopr   Ú_pickr    Úabcr!   Úcellsr#   r~   r$   Újupyterr%   r&   Úmeasurer'   rÖ   r(   rI   r)   r*   r+   r,   r-   r.   rn   r7   r8   Úobjectr@   r#  rA   rF   r–   rÌ   r_   r3   rX   rw   r\   r›   r    r¢   Ú_EnvironÚdictÚ	frozensetrú   r
  rß   r®   ro   Úkeysr°   rÿ   r²   r³   rÍ   rà   r  r†   rf   rk   r  r  r  ÚdÚdatarü   rq   r[   r%  r5   r5   r5   r6   Ú<module>   sÀ  
 <ÿ 
÷ÿþýüûúùø	÷


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

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