o
    ò‘OjàŽ  ã                   @   sp  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m Z  d d	l!m"Z" zd dl#Z$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l-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7 ddl8m9Z9 erÉddl:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@ dhZAdedeBfdd„ZCdeded fdd„ZDdeEdeBfdd „ZFe Gd!g ¡ZHdeEdeBfd"d#„ZI		$					d}d%ed&ed' d(d)d*eBd+eBd,eeJ d-eeJ d.eBddfd/d0„ZKdeEd1e eLeeLd2f f deBfd3d4„ZM		$					d}d&ed' d(d)d*eBd+eBd,eeJ d-eeJ d.eBddfd5d6„ZNG d7d8„ d8e4ƒZOd9eeef deePePePf fd:d;„ZQd9d<deePePePf fd=d>„ZRejSd?d@„ eeRe
eQedAd@„ edBd@„ eTdCd@„ edDd@„ eUdEd@„ eVdFd@„ e	dGd@„ eWdHd@„ eXdId@„ edJd@„ iZYeeLeegeePePePf f f eZdK< eXeY [¡ ƒZ\eTejSeefZ]dedeBfdLdM„Z^eG dNdO„ dOƒƒZ_eG dPdQ„ dQƒƒZ`dedeBfdRdS„Za			d~d9ed,eeJ d-eeJ dTeeJ de_f
dUdV„ZbdWdXdddddYœd9edZeJd[eJd,eeJ d-eeJ dTeeJ d.eBdePfd\d]„Zcdd
ddddd^œd9ed&ed' d+eBd,eeJ d-eeJ dTeeJ d.eBddfd_d`„Zdeedak�r¶G dbdc„ dcƒZfd ddlmgZg G dedf„ dfegƒZhe
eJƒZidgeidh< ddidjdkdlh dm£geUh dn£ƒe
eVdog dp¢iƒeg dq¢ƒdrehdsdtdudvdwdxgƒefƒ dyœZjejdh  kej¡ d dzllmmZm emeOejd
d{d|�ƒ dS dS )é    N)Úarray)ÚCounterÚUserDictÚUserListÚdefaultdictÚdeque)Ú	dataclassÚfieldsÚis_dataclass)Úisclass)Úislice)ÚMappingProxyType)ÚTYPE_CHECKINGÚAnyÚCallableÚDefaultDictÚDictÚIterableÚListÚOptionalÚSequenceÚSetÚTupleÚUnion)ÚRichReprResultTFé   ©Úget_console)Ú	loop_last)Ú	pick_bool)ÚRichRenderable©Úcell_len)ÚReprHighlighter)ÚJupyterMixinÚJupyterRenderable)ÚMeasurement)ÚText)ÚConsoleÚConsoleOptionsÚHighlighterTypeÚJustifyMethodÚOverflowMethodÚRenderResultzmatplotlib.artist.ArtistÚobjÚreturnc                 C   s   t ot t| ƒ¡S )z1Check if an object was created with attrs module.)Ú
_has_attrsÚ_attr_moduleÚhasÚtype©r.   © r5   ú]/var/www/html/pharmsmart-cdr-gen/venv/lib/python3.10/site-packages/pip/_vendor/rich/pretty.pyÚ_is_attr_objectA   s   r7   z_attr_module.Attribute[Any]c                 C   s   t r	t t| ƒ¡S g S )zGet fields for an attrs object.)r0   r1   r	   r3   r4   r5   r5   r6   Ú_get_attr_fieldsF   s   r8   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__Ú	Exceptionr4   r5   r5   r6   Ú_is_dataclass_reprK   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Ú	TypeErrorr@   )r.   Úobj_fileÚdefault_repr_filer5   r5   r6   Ú_has_default_namedtuple_repr_   s   	ýrG   ÚignoreÚvalueÚconsoler(   Úoverflowr,   ÚcropÚindent_guidesÚ
max_lengthÚ
max_stringÚ
expand_allc              
   C   sæ   ddl m} ddlm}	 t| tƒs| d u rd S |ptƒ }|jrPg d¢}
|
D ]#}t| |d ƒ}t	 
|¡rHz|ƒ }W n	 ty@   Y q%w |d urH d S q%|| tƒrPd S t| |	ƒrY| ¡  |jt| tƒrb| n
t| |||||dd�|dd� d S )	Nr   )Úis_object_one_of_types)ÚConsoleRenderable)Ú_repr_html_Ú_repr_markdown_Ú_repr_json_Ú_repr_latex_Ú_repr_jpeg_Ú
_repr_png_Ú
_repr_svg_Ú_repr_mimebundle_é   )rK   rM   rN   rO   rP   ÚmarginT)rL   Únew_line_start)Ú_inspectrQ   rJ   rR   Ú_safe_isinstancer%   r   Ú
is_jupyterÚgetattrrA   Úismethodr>   ÚJUPYTER_CLASSES_TO_NOT_RENDERÚlineÚprintr    ÚPretty)rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   Úipython_repr_methodsÚrepr_methodÚmethodÚrepr_resultr5   r5   r6   Ú_ipy_display_hooks   sJ   



ÿ€

ÿù	
órk   Ú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.   rl   r5   r5   r6   r_   ¼   s
   ÿ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   NrI   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)rK   rM   rN   rO   rP   )rL   )ÚbuiltinsÚ_re   r_   r    rf   )rI   )rJ   rL   rP   rM   rN   rO   rK   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ÚpprintrI   r/   c              	      s&   | j rt|ˆƒ ˆˆˆˆˆ d�S t|ƒS )N)rJ   rK   rM   rN   rO   rP   )rr   rk   Úrepr)ÚselfrI   ©rP   r   rM   rN   rO   rK   r5   r6   Ú__call__ü   s   ù
z'install.<locals>.RichFormatter.__call__N)Ú__name__Ú
__module__Ú__qualname__rr   ÚboolÚ__annotations__r   rv   r5   ru   r5   r6   ÚRichFormatterù   s   
 $r|   z
text/plain)Úpip._vendor.richr   r   Úget_ipythonÚIPython.core.formattersrq   Údisplay_formatterÚ
formattersr>   ÚsysÚdisplayhook)rJ   rK   rL   rM   rN   rO   rP   rp   Úiprq   r|   Úrich_formatterr5   )rJ   rL   rP   r   rM   rN   rO   rK   r6   Ú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 )'rf   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ÚjustifyrK   Úno_wraprM   rN   rO   Ú	max_depthrP   r\   Úinsert_lineÚ_objectÚhighlighterr*   rˆ   r‰   r+   rK   r,   rŠ   rM   rN   rO   r‹   rP   r\   rŒ   r/   c                C   sX   || _ |ptƒ | _|| _|| _|| _|| _|| _|| _|	| _	|
| _
|| _|| _|| _d S ©N)r�   r#   rŽ   rˆ   r‰   rK   rŠ   rM   rN   rO   r‹   rP   r\   rŒ   )rt   r�   rŽ   rˆ   r‰   rK   rŠ   rM   rN   rO   r‹   rP   r\   rŒ   r5   r5   r6   Ú__init__%  s   
zPretty.__init__rJ   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_widthrˆ   rN   rO   r‹   rP   Úpretty)r‰   rK   rŠ   Ústylez.__repr__ returned empty stringz
dim italic)r•   zrepr.indentÚ
Ú )Úpretty_reprr�   r“   r\   rˆ   rN   rO   r‹   rP   r'   r‰   rK   r   rŠ   rŽ   r3   rM   Ú
ascii_onlyÚwith_indent_guidesrŒ   )rt   rJ   r‘   Ú
pretty_strÚpretty_textr5   r5   r6   Ú__rich_console__D  s>   €
ù	

û	ÿþýÿ
zPretty.__rich_console__r&   c                 C   sH   t | j|j| j| j| j| jd�}|rtdd„ | ¡ D ƒƒnd}t	||ƒS )N)r“   rˆ   rN   rO   rP   c                 s   ó   � | ]}t |ƒV  qd S r�   r!   ©Ú.0rd   r5   r5   r6   Ú	<genexpr>s  ó   € z*Pretty.__rich_measure__.<locals>.<genexpr>r   )
r˜   r�   r“   rˆ   rN   rO   rP   ÚmaxÚ
splitlinesr&   )rt   rJ   r‘   r›   Ú
text_widthr5   r5   r6   Ú__rich_measure__g  s   ú	ÿ
zPretty.__rich_measure__r�   )rJ   r(   r‘   r)   r/   r-   )rJ   r(   r‘   r)   r/   r&   )rw   rx   ry   Ú__doc__r   r   Úintrz   r�   r�   r¦   r5   r5   r5   r6   rf     st    ýñþýûúùø	÷
öõôóòñ
ðÿÿ
þ#ÿÿþrf   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_defaultdictx  s   ýr­   z
array[Any]c                 C   r©   )Nzarray(z, [ú])ú))Útypecoder¬   r5   r5   r6   Ú_get_braces_for_array€  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deque([r®   zdeque()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__)r_   Ú_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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_tupleÚis_namedtupleNÚchildrenz: z, Ú	separatorr/   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Ã   Úkey_separatorrÄ   rË   rÅ   rÉ   rÊ   ÚlenÚiter_tokensrÈ   rÌ   rÆ   rÇ   )rt   Úchildr5   r5   r6   rÐ   ±  s(   €

€ózNode.iter_tokensÚstart_lengthrN   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"   )rt   rÒ   rN   Útotal_lengthÚtokenr5   r5   r6   Úcheck_lengthÇ  s   
ÿzNode.check_lengthc                 C   s   d  |  ¡ ¡}|S ©Nr—   )ÚjoinrÐ   )rt   Ú	repr_textr5   r5   r6   Ú__str__Ø  s   zNode.__str__éP   r‡   r“   rˆ   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   r–   c                 s   rž   r�   )ÚstrrŸ   r5   r5   r6   r¡   ò  r¢   zNode.render.<locals>.<genexpr>)Ú_LinerÏ   Ú
expandableÚexpandedrÕ   Úexpandr×   )rt   r“   rˆ   rP   ÚlinesÚline_nord   Úrepr_strr5   r5   r6   ÚrenderÜ  s   ûzNode.render)rÚ   r‡   F)rw   rx   ry   r§   rÃ   rÝ   r{   rÄ   rÅ   rÆ   rÇ   rÈ   rz   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Û   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)rz   rÛ   rË   ©rt   r5   r5   r6   rß     s   z_Line.expandablerN   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Õ   )rt   rN   rÒ   r5   r5   r6   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È   )rt   rˆ   rÛ   ré   Únew_lineÚchild_whitespaceÚtuple_of_onerÈ   rÑ   rÌ   rd   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è   Úrstriprê   r5   r5   r6   rÙ   1  s   "ÿz_Line.__str__)rw   rx   ry   r§   ræ   r   r{   rÜ   rz   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)ra   r>   rm   Útuple)r.   r	   r5   r5   r6   Ú_is_namedtuple:  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 ú>)r_   ÚbytesrÝ   rÏ   rs   r>   )r.   Ú	truncatedÚobj_reprÚerror)rO   r5   r6   Úto_reprb  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�}�n¦|	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›�nRt|	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,�nÉtˆjj› d�g |d�}�n»tˆƒ�rÞtˆt ƒ�sÞ|�sÞtˆƒ�s|dk�rÞt ˆƒ}|ˆv �r�td
d�S ˆ|ƒ g }|j}|�r td
d�}�n‚tˆjj› d�d||d�}tdd„ t!ˆƒD ƒƒD ]\}}ˆtˆ|j"ƒ|d d�}|j"|_||_d|_||ƒ �q¸ˆ|ƒ �nDt#ˆƒ�r/t$ˆƒ�r/|�ròtd
d�}�n0g }ˆjj}t|› d�d||› d�d�}|j}tˆ %¡  &¡ ƒD ]\}\}}ˆ||d d�}||_||_d|_||ƒ �qnótˆt'ƒ�rt'D ]}tˆ|ƒ�rC|} n�q7t ˆƒ}|ˆv �rStd
d�S ˆ|ƒ t(| ˆƒ\}}}|�rjt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ƒ|_/t#ˆƒ|_0|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   )r_   rò   rÏ   )rý   ÚargÚkeyrÑ   Údefaultr5   r5   r6   Úiter_rich_args~  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)rs   ra   Únamer>   Úcallable)ÚattrrI   rù   ©Úattr_fieldsr.   r5   r6   Ú
iter_attrsÚ  s   €€þý€øz/traverse.<locals>._traverse.<locals>.iter_attrs)rþ   é   c                 s   s   � | ]}|j r|V  qd S r�   )rs   )r    Úfieldr5   r5   r6   r¡     s   € ÿ
ÿz.traverse.<locals>._traverse.<locals>.<genexpr>)rÅ   rÆ   rË   rÇ   )rÄ   rÈ   z... +T)rÇ   rË   rÈ   )1r3   r‚   Úversion_infoÚmajorÚminorr   r   r   r   rÝ   rÀ   r>   r   r¾   ra   ÚlistÚ	__class__rw   ÚappendrÂ   r   r_   rò   rÈ   rÃ   rÎ   r7   r8   r   r   r
   r?   Úidr	   r  ró   rG   Ú_asdictÚitemsr¿   r½   r9   rÏ   Ú_MAPPING_CONTAINERSÚiterr   Ú	enumeraterÉ   rÊ   )#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  rI   Úrepr_callableÚobj_idr  Úcontainer_typerÅ   rÆ   rÇ   Ú	num_itemsÚlast_item_indexÚ
iter_itemsÚindexÚiter_values)Ú	_traverser‹   rN   Úpop_visitedÚpush_visitedrú   Úvisited_idsr  r6   r,  v  s€  &ÿÿ€ÿ
ûü


õ
ýüÿø

ÿÿþýüü

üÿüûþ

ü



ü


€

ztraverse.<locals>._traverseT)rû   N)Fr   )r   rÝ   ÚsetÚaddÚremoverz   r¨   rÂ   )r�   rN   rO   r‹   rÛ   r5   )r,  r‹   rN   rO   r-  r.  rú   r/  r6   ÚtraverseM  s   , ur3  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.
    )rN   rO   r‹   )r“   rˆ   rP   )r_   rÂ   r3  rå   )	r�   r“   rˆ   rN   rO   r‹   rP   rÛ   rä   r5   r5   r6   r˜   n  s   
ÿÿr˜   )rJ   rM   rN   rO   r‹   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.
    NrH   )rN   rO   r‹   rM   rP   rK   T)Ú	soft_wrap)r   re   rf   )r�   rJ   rM   rN   rO   r‹   rP   Ú_consoler5   r5   r6   rr   –  s   ù	
örr   Ú__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 failr5   rê   r5   r5   r6   r9   ¾  s   zBrokenRepr.__repr__N)rw   rx   ry   rÝ   r9   r5   r5   r5   r6   r7  ½  s    r7  )Ú
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)rw   rx   ry   rÝ   r{   Úfloatr   r5   r5   r5   r6   r9  Ä  s   
 r9  é   ÚfoozHello World!gZd;ßY@gÁÊ¡E¶3t@g    cA>   ©r   rÿ   rþ   r‡   r?  r  é   é   >   r   rÿ   rþ   Úcrumble)ÚappleÚrhubarbÚbutterÚsugarÚflour)rE  ÚorangeÚpearÚkumquatrL  ÁX  duriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTNzSparkling British Spring WaterzCarbonated spring watergÍÌÌÌÌÌì?Úwaterzits amazing!zits terrible!)r@  Úbarr   ÚcounterÚatomicÚ
namedtupleÚBroken)re   é   )rM   rO   )NrH   FFNNF)NNN)nrn   Úcollectionsr<   rA   Úosr‚   r   r   r   r   r   r   r   r	   r
   r   Ú	itertoolsr   Útypesr   Útypingr   r   r   r   r   r   r   r   r   r   r   r   Úpip._vendor.rich.reprr   r
  r1   r0   ÚImportErrorr—   r   Ú_loopr   Ú_pickr   Úabcr    Úcellsr"   rŽ   r#   Újupyterr$   r%   Úmeasurer&   rç   r'   rJ   r(   r)   r*   r+   r,   r-   rc   rz   r7   r8   Úobjectr?   rR  r@   rG   r¨   rk   r3   r_   r†   rf   rÝ   r­   r±   Ú_EnvironÚdictÚ	frozensetr  r0  rò   r½   r{   Úkeysr¿   r  rÁ   rÂ   rÞ   ró   r3  r˜   rr   rw   r7  r8  r9  ÚdÚdatar  r}   re   r5   r5   r5   r6   Ú<module>   s°  
 8ÿ ýøÿþýüûúùø	
÷Iÿÿ
þùÿþýüûúù
øK$g
(ó
TCüÿþýü
û  &øÿýüûúùø	
÷+øÿýüûúùø	
÷
%ú
ÿÿ
ûá!É