a
    ýÓEb<  ã                   @   sl  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%yô   dZ$Y n0 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? ee@dœdd„ZAeed dœdd„ZBeCe@dœdd„ZDdceed d e@e@eeE eeE e@dd!œ	d"d#„ZFdded d e@e@eeE eeE e@dd$œd%d&„ZGG d'd(„ d(e3ƒZHeeef eeIeIeIf d)œd*d+„ZJd,eeIeIeIf d)œd-d.„ZKejLd/d0„ eeKeeJed1d0„ ed2d0„ eMd3d0„ e	d4d0„ eNd5d0„ eOd6d0„ e
d7d0„ ePd8d0„ eQd9d0„ ed:d0„ iZReeSeegeeIeIeIf f f eTd;< eQeR U¡ ƒZVeMejLee	fZWee@dœd<d=„ZXeG d>d?„ d?ƒƒZYeG d@dA„ dAƒƒZZdeeeeE eeE eeE eYdBœdCdD„Z[dEdFdddddGœeeEeEeeE eeE eeE e@eIdHœdIdJ„Z\ddKdddddLœeed e@eeE eeE eeE e@ddMœdNdO„Z]e^dPk�rhG dQdR„ dRƒZ_eeEƒZ`dSe`dT< d
dUdVdWdXh dY£geNh dZ£ƒeeOd[g d\¢iƒeg d]¢ƒd^e_ƒ d_œZaeadT  bea¡ d d`lcmdZd edeHeadKdadb�ƒ dS )fé    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_moduleZhasÚtype©r.   © r3   úW/home/ja/django-apps/lartica_env/lib/python3.9/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)r0   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 0 dS )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.
    FN)Ú__repr__Ú__code__Úco_filenameÚdataclassesÚ__file__Ú	Exceptionr2   r3   r3   r4   Ú_is_dataclass_reprB   s    r=   ÚignoreFr'   r+   )	ÚvalueÚconsoleÚoverflowÚcropÚindent_guidesÚ
max_lengthÚ
max_stringÚ
expand_allr/   c              
   C   sÐ   ddl m} t| tƒs| d u r"d S |p*tƒ }|jrŠg d¢}	|	D ]J}
t| |
d ƒ}t |¡r>z
|ƒ }W n t	yx   Y q>Y n0 |d ur> d S q>t| |ƒrœ| 
¡  |jt| tƒr®| nt| |||||dd�|dd� d S )Nr   )ÚConsoleRenderable)Z_repr_html_Z_repr_markdown_Z_repr_json_Z_repr_latex_Z_repr_jpeg_Z
_repr_png_Z
_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   Zipython_repr_methodsZrepr_methodÚmethodZrepr_resultr3   r3   r4   Ú_ipy_display_hookS   s@    






ÿù	órU   )r@   rA   rB   rC   rD   rE   rF   r/   c                    s¦   ddl m‰ ˆ pˆƒ ‰ ˆ dus"J ‚tddœ‡ ‡‡‡‡‡‡fdd„}zFtƒ }ddlm}	 G ‡‡‡‡‡‡fdd	„d	|	ƒ}
|
ƒ }||jjd
< W n ty    |t	_
Y n0 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.
        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   N©r?   r/   c              	      sP   | durLˆ dusJ ‚dt _ˆ jt| tƒr,| nt| ˆˆˆˆˆd�ˆd� | t _dS )z?Replacement sys.displayhook which prettifies objects with Rich.N)rA   rC   rD   rE   rF   )rB   )ÚbuiltinsÚ_rR   rL   r   rS   )r?   )r@   rB   rF   rC   rD   rE   rA   r3   r4   Údisplay_hook®   s"    ÿúõzinstall.<locals>.display_hook)ÚBaseFormatterc                       s8   e Zd ZU dZeed< eedœ‡ ‡‡‡‡‡fdd„ZdS )zinstall.<locals>.RichFormatterTÚpprintrV   c              	      s*   | j rt|ˆƒ ˆˆˆˆˆ d�S t|ƒS d S )N)r@   rA   rC   rD   rE   rF   )r[   rU   Úrepr)Úselfr?   ©rF   r   rC   rD   rE   rA   r3   r4   Ú__call__É   s    ù
z'install.<locals>.RichFormatter.__call__N)Ú__name__Ú
__module__Ú__qualname__r[   ÚboolÚ__annotations__r   r_   r3   r^   r3   r4   ÚRichFormatterÆ   s   
re   z
text/plain)Úpip._vendor.richr   r   Úget_ipythonZIPython.core.formattersrZ   Zdisplay_formatterZ
formattersr<   ÚsysÚdisplayhook)r@   rA   rB   rC   rD   rE   rF   rY   ÚiprZ   re   Zrich_formatterr3   )r@   rB   rF   r   rC   rD   rE   rA   r4   Úinstall“   s    
 rk   c                   @   s”   e Zd ZdZdddddddddddddœeed eed ed	 ee eee ee ee eeedd
œdd„Zddddœdd„Z	ddddœdd„Z
dS )rS   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   rJ   Úinsert_liner)   r*   r+   )Ú_objectÚhighlighterrm   rn   rA   ro   rC   rD   rE   rp   rF   rJ   rq   r/   c                C   sX   || _ |ptƒ | _|| _|| _|| _|| _|| _|| _|	| _	|
| _
|| _|| _|| _d S ©N)rr   r"   rs   rm   rn   rA   ro   rC   rD   rE   rp   rF   rJ   rq   )r]   rr   rs   rm   rn   rA   ro   rC   rD   rE   rp   rF   rJ   rq   r3   r3   r4   Ú__init__ò   s    zPretty.__init__r'   r(   r,   )r@   Úoptionsr/   c              	   c   s¶   t | j|j| j | j| j| j| j| jd�}t	|| j
p8|j
| jpB|jt| j|jƒdd�}|rd|  |¡nt	t| jƒ› d�dd�}| jr˜|js˜|j| jdd�}| jr¬d|v r¬d	V  |V  d S )
N©Ú	max_widthrm   rD   rE   rp   rF   Úpretty)rn   rA   ro   Ústylez.__repr__ returned empty stringz
dim italic)rz   zrepr.indentÚ
Ú )Úpretty_reprrr   rx   rJ   rm   rD   rE   rp   rF   r&   rn   rA   r   ro   rs   r1   rC   Ú
ascii_onlyÚwith_indent_guidesrq   )r]   r@   rv   Ú
pretty_strZpretty_textr3   r3   r4   Ú__rich_console__  s<    
ù	

û	ÿþýÿzPretty.__rich_console__r%   c                 C   sD   t | j|j| j| j| jd�}|r6tdd„ | ¡ D ƒƒnd}t||ƒS )N)rx   rm   rD   rE   c                 s   s   | ]}t |ƒV  qd S rt   r    ©Ú.0rQ   r3   r3   r4   Ú	<genexpr>?  ó    z*Pretty.__rich_measure__.<locals>.<genexpr>r   )	r}   rr   rx   rm   rD   rE   ÚmaxÚ
splitlinesr%   )r]   r@   rv   r€   Ú
text_widthr3   r3   r4   Ú__rich_measure__4  s    ûÿzPretty.__rich_measure__)N)r`   ra   rb   Ú__doc__r   r   Úintrc   ru   r�   r‰   r3   r3   r3   r4   rS   Þ   sH    ýñð þ$þrS   )rr   r/   c                 C   s   d| j ›d�dd| j ›d�fS )Nzdefaultdict(z, {ú})z, {}))Údefault_factory©rr   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   s   dS )N)z	environ({rŒ   zenviron({})r3   rŽ   r3   r3   r4   Ú<lambda>Q  r…   r“   c                 C   s   dS )N)z	Counter({rŒ   z	Counter()r3   rŽ   r3   r3   r4   r“   T  r…   c                 C   s   dS )N)zdeque([r�   zdeque()r3   rŽ   r3   r3   r4   r“   U  r…   c                 C   s   dS ©N)ú{ú}z{}r3   rŽ   r3   r3   r4   r“   V  r…   c                 C   s   dS r”   r3   rŽ   r3   r3   r4   r“   W  r…   c                 C   s   dS )N)zfrozenset({rŒ   zfrozenset()r3   rŽ   r3   r3   r4   r“   X  r…   c                 C   s   dS ©N)ú[ú]z[]r3   rŽ   r3   r3   r4   r“   Y  r…   c                 C   s   dS r—   r3   rŽ   r3   r3   r4   r“   Z  r…   c                 C   s   dS )N)r•   r–   zset()r3   rŽ   r3   r3   r4   r“   [  r…   c                 C   s   dS )N)ú(ú)ú()r3   rŽ   r3   r3   r4   r“   \  r…   c                 C   s   dS )N)zmappingproxy({rŒ   zmappingproxy({})r3   rŽ   r3   r3   r4   r“   ]  r…   Ú_BRACESc                 C   s.   t | tƒs$t| ƒs$t| dƒs$t| ƒo,t| ƒ S )z3Check if an object may be expanded by pretty print.Ú__rich_repr__)rL   Ú_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< ee dœdd„Zeeedœdd„Zedœdd„Zdeeeedœ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, Ú	separator©r/   c                 c   s¬   | j r| j V  | jV  | jr&| jV  n‚| jdur¨| jr | jV  | jrnt| jƒdkrn| jd  ¡ E dH  dV  n(| jD ] }| ¡ E dH  |jst| j	V  qt| j
V  n| jV  dS )zGenerate tokens for this node.Nr   r   ú,)r£   Úkey_separatorr¤   rª   r¥   r©   ÚlenÚiter_tokensr¨   r«   r¦   r§   )r]   Úchildr3   r3   r4   r°   |  s"    




zNode.iter_tokens)Ústart_lengthrD   r/   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!   )r]   r²   rD   Útotal_lengthÚtokenr3   r3   r4   Úcheck_length’  s    
zNode.check_lengthc                 C   s   d  |  ¡ ¡}|S ©Nr|   )Újoinr°   )r]   Z	repr_textr3   r3   r4   Ú__str__£  s    zNode.__str__éP   rl   )rx   rm   rF   r/   c                 C   sx   t | dd�g}d}|t|ƒk r`|| }|jrV|jsV|s@| |¡sV| |¡|||d …< |d7 }q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   s   | ]}t |ƒV  qd S rt   )Ústrr‚   r3   r3   r4   r„   ½  r…   zNode.render.<locals>.<genexpr>)Ú_Liner¯   Ú
expandableÚexpandedrµ   Úexpandr·   )r]   rx   rm   rF   ÚlinesÚline_norQ   Úrepr_strr3   r3   r4   Úrender§  s    
zNode.render)r¹   rl   F)r`   ra   rb   rŠ   r£   r¼   rd   r¤   r¥   r¦   r§   r¨   rc   r©   rª   r   r   r®   r«   r   r°   r‹   rµ   r¸   rÄ   r3   r3   r3   r4   r¢   m  s&   
 ÿþ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edœdd„ƒZeedœdd„Zeed  dœdd„Zedœ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)rc   rº   rª   ©r]   r3   r3   r4   r¾   Î  s    z_Line.expandable)rD   r/   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µ   )r]   rD   r²   r3   r3   r4   rµ   Ó  s    ÿz_Line.check_length)rm   r/   c                 c   sØ   | j }|dusJ ‚| j}|js"J ‚|jrJt|j› |j› |j› �|d�V }nt|j|d�V }| jd|  }|jozt|jƒdk}t	|jƒD ]4\}}|r–dn|j
}	t||||	|o®| d�}
|
V  q†t|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¨   )r]   rm   rº   rÈ   Únew_lineZchild_whitespaceZtuple_of_oner¨   r±   r«   rQ   r3   r3   r4   rÀ   Û  s8    
þ
ûüz_Line.expandc                 C   sH   | j r | j› | j› | jpd› �S | j› | j› | jp4d› | j ¡ › �S d S r¶   )r¨   rÈ   rÆ   rº   rÇ   ÚrstriprÉ   r3   r3   r4   r¸   ü  s    "ÿz_Line.__str__)r`   ra   rb   rŠ   rÅ   r   rd   r»   rc   rº   r¢   rÆ   r¼   rÇ   rÈ   r¿   r¨   Úpropertyr¾   r‹   rµ   r   rÀ   r¸   r3   r3   r3   r4   r½   Á  s   
!r½   )rr   rD   rE   rp   r/   c              	      s\   t tdœ‡fdd„‰tƒ ‰ˆj‰ˆj‰dt tttdœ‡ ‡‡‡‡‡‡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-   c              
      sŒ   ˆ durFt | ttfƒrFt| ƒˆ krFt| ƒˆ  }| dˆ … ›d|› �}nBzt| ƒ}W n4 ty† } zdt|ƒ›d�}W Y d}~n
d}~0 0 |S )z0Get repr string for an object, but catch errors.Nú+z<repr-error ú>)rL   Úbytesr¼   r¯   r\   r<   )r.   Z	truncatedÚobj_reprÚerror)rE   r3   r4   Úto_repr  s    ÿþ
ý&ztraverse.<locals>.to_reprFr   )r.   ÚrootÚdepthr/   c           #         s¸  t ˆƒ}tjjtjjf}ˆduo&|ˆk}tttttt	tf f  dœdd„}zt
ˆdƒ}W n typ   d}Y n0 d}|s¬zt
ˆdƒr–tˆƒs–ˆ ¡ }W n tyª   Y n0 |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 ]h\}}t|tƒ�r€|\}}ˆ||d d�}||_||_d|_||ƒ nˆ||d d�}||_||ƒ �q8n&t|	�r¸d|› d�n|› d�g |d�}�nÚtˆƒ�rÐ|�sÐg }|j}tˆƒ‰ ˆ �r´|�rtd	d
�}nªtˆjj› d�d||d�}ttt	ttttgt	f  f  dœ‡ ‡fdd„}t|ƒ ƒD ]T\}\}}}|�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
�}nxtˆjj› d�d||d�}tdd„ t!ˆƒD ƒƒD ]>\}}ˆtˆ|j"ƒ|d d�}|j"|_||_d|_||ƒ �qpˆ|ƒ �nìtˆt#ƒ�r˜t#D ]}tˆ|ƒ�rÌ|} �qê�qÌt ˆƒ}|ˆv �rtd	d
�S ˆ|ƒ t$| ˆƒ\}}}|�r6td	|d�}�nX|j%t ˆƒj%k�r\tˆˆƒ|d�}�n2ˆ�r€g }t||||d�}|j}t&ˆƒ}|d }tˆt'ƒ�rþt(ˆ )¡ ƒ} ˆdu�r¸t*| ˆƒ} t+| ƒD ]:\}!\}}ˆ||d d�}ˆ|ƒ|_|!|k|_||ƒ �qÀnRt(ˆƒ}"ˆ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 ]x}t |tƒrvt|ƒdkr>|\}}}||kr2q||fV  q|t|ƒdkr^|\}}||fV  q|t|ƒdkr||d V  q|V  qd S )Né   é   r   r   )rL   Útupler¯   )rÖ   ÚargÚkeyr±   Údefaultr3   r3   r4   Úiter_rich_args6  s    

z3traverse.<locals>._traverse.<locals>.iter_rich_argsZ,awehoi234_wdfjwljet234_234wdfoijsdfmmnxpi492Frž   Úangularz...)r¤   ú<rÊ   rÏ   )r¥   r¦   rª   r¨   r«   rš   r›   )r¥   r¦   rª   r¨   r   )rÕ   ú=rœ   )r¤   rª   r¨   r¬   c                  3   sv   ˆ D ]l} | j rztˆ| jƒ}W n2 tyP } z| j|dfV  W Y d}~qd}~0 0 | j|t| j ƒrh| j ndfV  qdS )z$Iterate over attr fields and values.N)r\   rN   Únamer<   Úcallable)Úattrr?   rÒ   ©Zattr_fieldsr.   r3   r4   Ú
iter_attrs’  s    $ýz/traverse.<locals>._traverse.<locals>.iter_attrs)r×   é   c                 s   s   | ]}|j r|V  qd S rt   )r\   )rƒ   Úfieldr3   r3   r4   r„   Ê  s   z.traverse.<locals>._traverse.<locals>.<genexpr>)r¤   r¨   z... +T)r§   rª   r¨   )-r1   rh   Úversion_infoÚmajorÚminorr   r   r   r   r¼   r    r<   r   rž   rN   ÚlistÚ	__class__r`   Úappendr¢   r   rL   rÙ   r¨   r£   r®   r5   r6   r   r   r
   r=   Úidr	   rá   rŸ   r�   r7   r¯   Ú_MAPPING_CONTAINERSÚiterÚitemsr   Ú	enumerater©   )#r.   rÔ   rÕ   Zobj_typeÚ
py_versionZreached_max_depthrÝ   Zfake_attributesZrich_repr_resultrÞ   ÚargsÚ
class_namerª   rí   rº   r¨   rÚ   rÛ   r±   Z
child_noderå   rá   r?   Zrepr_callableZobj_idrç   Zcontainer_typer¥   r¦   r§   Z	num_itemsZlast_item_indexZ
iter_itemsÚindexÚiter_values)Ú	_traverserp   rD   Úpop_visitedÚpush_visitedrÓ   Úvisited_idsrä   r4   rø   .  sH   $ÿ


ûü
ý
üÿÿ
ÿþýüü

üÿ


ü







ztraverse.<locals>._traverseT)rÔ   )Fr   )r   r¼   ÚsetÚaddÚremoverc   r‹   r¢   )rr   rD   rE   rp   rº   r3   )rø   rp   rD   rE   rù   rú   rÓ   rû   r4   Útraverse  s    & brÿ   r¹   rl   rw   )rr   rx   rm   rD   rE   rp   rF   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.
    )rD   rE   rp   )rx   rm   rF   )rL   r¢   rÿ   rÄ   )	rr   rx   rm   rD   rE   rp   rF   rº   rÃ   r3   r3   r4   r}     s    
ÿÿr}   T)r@   rC   rD   rE   rp   rF   )rr   r@   rC   rD   rE   rp   rF   r/   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   rp   rC   rF   rA   T)Ú	soft_wrap)r   rR   rS   )rr   r@   rC   rD   rE   rp   rF   Ú_consoler3   r3   r4   r[   ;  s    ù	ör[   Ú__main__c                   @   s   e Zd Zedœ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)r`   ra   rb   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   rØ   r×   rl   >   r   rØ   r×   Zcrumble)ÚappleZrhubarbÚbutterZsugarZflour)r  ZorangeÚpearÚkumquatr  AX  duriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTN)r  Zbarr   ZcounterZatomicZBroken)rR   é   )rC   rE   )Nr>   FFNNF)Nr>   FFNNF)NNN)erW   r:   rO   ÚosÚrerh   r   Úcollectionsr   r   r   r   r   r   r	   r
   r   Ú	itertoolsr   Útypesr   Útypingr   r   r   r   r   r   r   r   r   r   r   Zpip._vendor.rich.reprr   rã   r0   ÚImportErrorr|   r   Ú_loopr   Ú_pickr   Úabcr   Úcellsr!   rs   r"   Újupyterr#   r$   Úmeasurer%   rÆ   r&   r@   r'   r(   r)   r*   r+   r,   rc   r5   r6   Úobjectr=   r‹   rU   rk   rS   r¼   r�   r’   Ú_EnvironÚdictÚ	frozensetrë   rü   rÙ   r�   r1   rd   ÚkeysrŸ   rï   r¡   r¢   r½   rÿ   r}   r[   r`   r  ÚdÚdatarí   rf   rR   r3   r3   r3   r4   Ú<module>   s<  
4
 
       ø÷A       ùøKf"
ó(
SE   üû  ø÷+ø÷%
ú
ÿÿ
è