
    <6h                        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" 	 d dl#Z$ e%e$d
      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l2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8 ddl9m:Z: erddl;m<Z<m=Z=m>Z>m?Z?m@Z@mAZA dedeBfdZCdeded   fdZDdeEdeBfdZF ej                  dg       ZHdeEdeBfdZI	 	 	 	 	 	 	 	 dmded ed!   d"d#d$eBd%eBd&eeJ   d'eeJ   d(eeJ   d)eBde eKdf   fd*ZLdeEd+e eMeeMd,f   f   deBfd-ZN	 	 	 	 	 	 	 	 dmd ed!   d"d#d$eBd%eBd&eeJ   d'eeJ   d(eeJ   d)eBddfd.ZO G d/ d0e5      ZPd1eeef   deeKeKeKf   fd2ZQd1d3deeKeKeKf   fd4ZRej                  d5 eeRe
eQed6 ed7 eTd8 ed9 eUd: eVd; e	d< eWd= eXd> ed? iZYeeMeegeeKeKeKf   f   f   eZd@<    eXeYj                               Z\eTej                  eefZ]dedeBfdAZ^e G dB dC             Z_e G dD dE             Z`dedeBfdFZa	 	 	 dnd1ed&eeJ   d'eeJ   d(eeJ   de_f
dGZbdHdIdddddJd1edKeJdLeJd&eeJ   d'eeJ   d(eeJ   d)eBdeKfdMZcddNdddddOd1ed ed!   d%eBd&eeJ   d'eeJ   d(eeJ   d)eBddfdPZdeedQk(  r G dR dS      Zfd dTlmgZg  G dU dVeg      Zh e
eJ      ZidWeidX<   ddYdZd[d\h d]g eUh d^       e
eVd_g d`i       eg da      db ehdcdddedfdgdhg       ef       diZjejdX   j                  ej       d djllmmZm  G dk dl      Zn em eP en                    yy# e'$ r dZ&Y w xY w)o    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)RichReprResultibF   get_console)	loop_last)	pick_bool)RichRenderablecell_len)ReprHighlighter)JupyterMixinJupyterRenderable)Measurement)Text)ConsoleConsoleOptionsHighlighterTypeJustifyMethodOverflowMethodRenderResultobjreturnc                 N    t         xr t        j                  t        |             S )z1Check if an object was created with attrs module.)
_has_attrs_attr_modulehastyper0   s    \/var/www/panel.atabookie.online/venv/lib/python3.12/site-packages/pip/_vendor/rich/pretty.py_is_attr_objectr9   :   s    5,**4955    z_attr_module.Attribute[Any]c                 N    t         rt        j                  t        |             S g S )zGet fields for an attrs object.)r3   r4   r
   r6   r7   s    r8   _get_attr_fieldsr<   ?   s    -7<tCy)?R?r:   c                     	 | j                   j                  j                  t        j                  k(  S # t
        $ r Y yw xY w)zCheck 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__	Exceptionr7   s    r8   _is_dataclass_reprrD   D   s:    ||$$00K4H4HHH s   03 	??_dummy_namedtuplec                     d}	 t        j                  | j                        }t        j                  t
        j                        }||k(  S # t        t        f$ r Y 9w xY w)zCheck 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	TypeErrorrE   )r0   obj_filedefault_repr_files      r8   _has_default_namedtuple_reprrM   X   s_     H??3<<0
  (9(B(BC((( Y  	s   A AAvalueconsoler*   overflowr.   cropindent_guides
max_length
max_string	max_depth
expand_allc	                    ddl m}	 t        | t              s| y |xs
 t	               }|j                         5 }
t        | |	      r|j                          |j                  t        | t              r| nt        | ||||||d      |dd       d d d        
j                         j                  d      S # 1 sw Y   (xY w)	Nr   )ConsoleRenderable   )rP   rR   rS   rT   rU   rV   marginT )rQ   new_line_startend
)rO   rX   _safe_isinstancer'   r   capturelineprintr"   Prettygetrstrip)rN   rO   rP   rQ   rR   rS   rT   rU   rV   rX   r`   s              r8   _ipy_display_hookrf   l   s     + 01U]&G		 
gE#45LLN~6 !+%%#%	  	 	
	
. ;;=%%/
 
s   AB44B=class_or_tuple.c                 :    	 t        | |      S # t        $ r Y yw xY w)zFisinstance can fail in rare cases, for example types with no __class__F)
isinstancerC   )r0   rg   s     r8   r_   r_      s&    #~.. s    	c           	           ddl m  xs           J dt        ddf fd}dt               v rDt	               }	ddlm}
  G fd	d
|
      } |       }||	j                  j                  d<   y|t        _
        y)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   NrN   r1   c                     | PJ dt         _        j                  t        | t              r| nt        |              | t         _        yy)z?Replacement sys.displayhook which prettifies objects with Rich.N)rP   rR   rS   rT   rU   rV   )rQ   )builtins_rb   r_   r"   rc   )	rN   rO   rQ   rV   rR   rU   rS   rT   rP   s	    r8   display_hookzinstall.<locals>.display_hook   sl    &&&HJMM#E>: %"/))')    HJ# r:   get_ipython)BaseFormatterc                   >    e Zd ZU dZeed<   dedef fdZy)install.<locals>.RichFormatterTpprintrN   r1   c           
      b    | j                   rt        |              S t        |      S )N)rO   rP   rR   rS   rT   rU   rV   )rs   rf   repr)	selfrN   rV   r   rR   rU   rS   rT   rP   s	     r8   __call__z'install.<locals>.RichFormatter.__call__   s=    ;;, +!)&3#-#-"+#-	 	  ;&r:   N)__name__
__module____qualname__rs   bool__annotations__r   rw   )rV   r   rR   rU   rS   rT   rP   s   r8   RichFormatterrr      s%    FD'c 'c ' 'r:   r}   z
text/plain)pip._vendor.richr   r   globalsro   IPython.core.formattersrp   display_formatter
formatterssysdisplayhook)rO   rP   rQ   rR   rS   rT   rU   rV   rn   iprp   r}   rich_formatterr   s   ````````     @r8   installr      s    0 -&GC D  * 	!]9	' 	'M 	'& '8F''5&r:   c                       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Z	 	 	 	 	 	 ddZ		 	 	 	 	 	 ddZ
y)rc   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justifyrP   no_wraprR   rS   rT   rU   rV   rZ   insert_line_objecthighlighterr,   r   r   r-   rP   r.   r   rR   rS   rT   rU   rV   rZ   r   r1   c                    || _         |xs
 t               | _        || _        || _        || _        || _        || _        || _        |	| _	        |
| _
        || _        || _        || _        y N)r   r%   r   r   r   rP   r   rR   rS   rT   rU   rV   rZ   r   )rv   r   r   r   r   rP   r   rR   rS   rT   rU   rV   rZ   r   s                 r8   __init__zPretty.__init__  sk    " &;/*;&294<*$$"$&r:   c           	   #     K   t        | j                  |j                  | j                  z
  | j                  | j
                  | j                  | j                  | j                        }t        j                  || j                  xs |j                  | j                  xs |j                  t        | j                  |j                        d      }|r| j                  |      n"t        t!        | j                         dd      }| j"                  r)|j$                  s|j'                  | j                  d      }| j(                  rd|v rd	 | y w)
N	max_widthr   rS   rT   rU   rV   pretty)r   rP   r   stylez.__repr__ returned empty stringz
dim italic)r   zrepr.indentr^   r[   )pretty_reprr   r   rZ   r   rS   rT   rU   rV   r)   	from_ansir   rP   r!   r   r   r6   rR   
ascii_onlywith_indent_guidesr   )rv   rO   options
pretty_strpretty_texts        r8   __rich_console__zPretty.__rich_console__&  s$     !LL''$++5((nn

 nnLL3GOO]]6g&6&6dllGOO<
  [)%&&EF" 	 g&8&8%88   9 K  3Hs   EEc           	         t        | j                  |j                  | j                  | j                  | j
                  | j                  | j                        }|r t        d |j                         D              nd}t        ||      S )Nr   c              3   2   K   | ]  }t        |        y wr   r#   .0ra   s     r8   	<genexpr>z*Pretty.__rich_measure__.<locals>.<genexpr>V  s     C4C   r   )r   r   r   r   rS   rT   rU   rV   max
splitlinesr(   )rv   rO   r   r   
text_widths        r8   __rich_measure__zPretty.__rich_measure__I  sw     !LL''((nn

 HRCC:+@+@+BCCWX 	 :z22r:   r   )rO   r*   r   r+   r1   r/   )rO   r*   r   r+   r1   r(   )rx   ry   rz   __doc__r   r   intr{   r   r   r    r:   r8   rc   rc      s   , 48'
 -1/3"'#$($(#' !'' /0'
 ' /*' +,' $' ' SM' SM' C=' ' ' '  
!'>! !+;!	!F3 3+;3	3r:   rc   r   c                 D    d| j                   ddd| j                   dfS )Nzdefaultdict(z, {})z, {}))default_factoryr   s    r8   _get_braces_for_defaultdictr   [  s5    
w..16
w..19 r:   z
array[Any]c                 D    d| j                   ddd| j                   dfS )Nzarray(z, [])))typecoder   s    r8   _get_braces_for_arrayr   c  s0    W%%(,dfW=M=M<PPQ4RSSr:   c                      y)N)z	environ({r   zenviron({})r   r   s    r8   <lambda>r   h      r:   c                      y)N)z	Counter({r   z	Counter()r   r   s    r8   r   r   k  r   r:   c                      y)N)zdeque([r   zdeque()r   r   s    r8   r   r   l  r   r:   c                      yN){}z{}r   r   s    r8   r   r   m  r   r:   c                      yr   r   r   s    r8   r   r   n  r   r:   c                      y)N)zfrozenset({r   zfrozenset()r   r   s    r8   r   r   o  r   r:   c                      yN)[]z[]r   r   s    r8   r   r   p  r   r:   c                      yr   r   r   s    r8   r   r   q  r   r:   c                      y)N)r   r   zset()r   r   s    r8   r   r   r  r   r:   c                      y)N)(r   ()r   r   s    r8   r   r   s  r   r:   c                      y)N)zmappingproxy({r   zmappingproxy({})r   r   s    r8   r   r   t  r   r:   _BRACESc                     t        | t              xs& t        |       xs t        | d      xs t	        |       xr t        |        S )z3Check if an object may be expanded by pretty print.__rich_repr__)r_   _CONTAINERSr   hasattrr9   r   r7   s    r8   is_expandabler   z  sO     	k* 	 	 C)	  3	
 cl
r:   c            	          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ZdededefdZdefdZ	 ddedededefdZy)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: key_separatorz, 	separatorr1   c              #   ^  K   | j                   r| j                    | j                   | j                  r| j                   y| j                  | j                  r| j                   | j
                  rN| j                  sBt        | j                        dk(  r*| j                  d   j                         E d{    d nD| j                  D ]5  }|j                         E d{    |j                  r(| j                   7 | j                   y| j                   yy7 l7 Bw)zGenerate tokens for this node.Nr   r   ,)r   r   r   r   r   r   r   leniter_tokensr   r   r   r   )rv   childs     r8   r   zNode.iter_tokens  s     ==--$$$??//!]]&}}oo%==););DMM@RVW@W#}}Q/;;===I!% 1#(#4#4#666$zz"&..01 &&&jj  ' > 7s*   B:D-<D)=+D-(D+)D-:0D-+D-start_lengthrS   c                 \    |}| j                         D ]  }|t        |      z  }||kD  s y y)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$   )rv   r   rS   total_lengthtokens        r8   check_lengthzNode.check_length  s?     $%%' 	EHUO+Lj(	 r:   c                 D    dj                  | j                               }|S Nr[   )joinr   )rv   	repr_texts     r8   __str__zNode.__str__  s    GGD,,./	r:   r   r   rV   c                 (   t        | d      g}d}|t        |      k  r[||   }|j                  r6|j                  s*|s|j	                  |      s|j                  |      |||dz    |dz  }|t        |      k  r[dj                  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              3   2   K   | ]  }t        |        y wr   )strr   s     r8   r   zNode.render.<locals>.<genexpr>  s     94SY9r   )_Liner   
expandableexpandedr   expandr   )rv   r   r   rV   linesline_nora   repr_strs           r8   renderzNode.render  s     D$/0E
">Dt}}T%6%6y%A37;;{3KE'GaK0qLG E
" 999599r:   )P   r   F)rx   ry   rz   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:   r8   r   r     s    >HcJJKE3OD$HdM4'+HhtF|$+M3Is!Xc] !, # $ " 
 MR03EI	r:   r   c                       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       ZdedefdZdeded    fdZdefdZy)r   zA line in repr output.NparentFr   r   r[   textsuffix
whitespacer   r   r1   c                 `    t        | j                  duxr | j                  j                        S )z"Check if the line may be expanded.N)r{   r   r   rv   s    r8   r   z_Line.expandable  s'     DIIT)@dii.@.@AAr:   rS   c                     t        | j                        t        | j                        z   t        | j                        z   }| j
                  J | j
                  j                  ||      S )z4Check this line fits within a given number of cells.)r   r   r$   r   r   r   r   )rv   rS   r   s      r8   r   z_Line.check_length  sZ      8DII#66$++9NN 	 yy$$$yy%%lJ??r:   r   c           	   #   l  K   | j                   }|J | j                  }|j                  sJ |j                  r4t	        |j                   |j
                   |j                   |      }nt	        |j                  |      }| j                  d|z  z   }|j                  xr t        |j                        dk(  }t        |j                        D ].  \  }}|rdn|j                  }	t	        ||||	|xr |       }
|
 0 t	        |j                  || j                  | j                         yw)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   )rv   r   r   r   new_linechild_whitespacetuple_of_oner   r   r   ra   s              r8   r   z_Line.expand  s(    yy__
}}}=="t'9'9&:4??:KL% H
 #JOOH??S;->>}}@T]]);q)@$T]]3 		KD%+I+ .,.D J		 !!!;;	
 	
s   D2D4c                     | j                   r*| j                   | j                   | j                  xs d S | j                   | j                   | j                  xs d | j                  j                          S r   )r   r   r   r   r   re   r  s    r8   r   z_Line.__str__  si    99oo&tyyk$))/r1BCC ??#DII;tyyB.?@R@R@T?UVr:   )rx   ry   rz   r   r   r   r|   r   r{   r   r   r   r   r   r   r   r   propertyr   r   r   r   r   r   r   r:   r8   r   r     s      $FHW$GTD(4.D#NFCJHdD$BD B B@s @t @
# 
(7*; 
B r:   r   c                     	 t        | dd      }t        | t              xr t        |t              S # t        $ r Y yw xY w)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)getattrrC   ri   tuple)r0   r
   s     r8   _is_namedtupler    sD    i. c5!?j&??  s   1 	==c           	         	 dt         dt        ffdt               		j                  	j                  d	dt         dt
        dt        dt        f	f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                     >t        | t        t        f      r(t        |       kD  rt        |       z
  }| d d| }|S 	 t	        |       }|S # t
        $ r}dt        |      d}Y d}~|S d}~ww xY w)z0Get repr string for an object, but catch errors.N+z<repr-error >)r_   bytesr   r   ru   rC   )r0   	truncatedobj_reprerrorrT   s       r8   to_reprztraverse.<locals>.to_reprE  s     " ucl3C:%C:-Ikz*-Qyk:H 	:9   :)#e*q9:s   A 	A3A..A3rootdepthc           	      P   " t               }|)v rt        d      S t               }$duxr |$k\  }dt        dt        t
        t        t        t        t        f   f      fd}	 t         d      }d}|s(	 t         d	      rt               s j                         }|7 '|       t         j                  d
d      }	t         ||            }
 j                  j                  }|
rg }|j                   }|r#|	rt        d| d      }nt        | d      }n|	rt        d| dd||d      }nt        | dd||      }t#        |
      D ]a  \  }}t%        |t&              r0|\  }} #||dz         }||_        ||_        d|_         ||       F #||dz         }||_         ||       c nt        |	rd| dn| dg |      } &|       nt/               rA|s> '|       g }|j                   }t1               ""r|r$t         j                  j                   d      }nt         j                  j                   dd||      }dt        t        t        t        t2        t4        t        gt        f      f      f" fd}t#         |             D ]Q  \  }\  }}}|rt        t         ||                  }n #||dz         }||_        ||_        d|_         ||       S n%t         j                  j                   dg |      } &|       nt7               rt%         t              s|st9               r '|       g }|j                   }|r$t         j                  j                   d      }nt         j                  j                   dd|| j                  j                   d      }t#        d t;               D              D ]M  \  }} #t         |j<                        |dz         }|j<                  |_        ||_        d|_         ||       O  &|       nt?               rtA               r '|        j                  j                  }|rt        | d      }ng }|j                   }t        | dd|| d      }t#         jC                         jE                               D ]2  \  }\  }} #||dz         }||_        ||_        d|_         ||       4  &|       nt%         tF              rtF        D ]  }t%         |      s|} n  '|       tI        |          \  }}}|rt        | d|       }n[|jJ                  t               jJ                  k7  rt         (       |      }n$ rg }t        ||||      }|j                   }tM               }|dz
  }t%         tN              rjtQ         jE                               }%tS        |%      }tU        |      D ]4  \  } \  }} #||dz         } (|      |_        | |k(  |_         ||       6 nKtQ               }!%tS        |!%      }!tU        |!      D ]$  \  } } #||dz         }| |k(  |_         ||       & %-|%kD  r( |t        d|%z
   d             nt        |g |       } &|       nt         (       |      }t%         t&              |_+        t?               |_,        |S # t        $ r d}Y w xY w# t        $ r Y w xY w)!zWalk the object depth first.z...)r   N	rich_argsr1   c              3      K   | D ]h  }t        |t              rRt        |      dk(  r|\  }}}||k(  r-||f 4t        |      dk(  r|\  }}||f Nt        |      dk(  s]|d    e| j y w)N      r   r   )r_   r  r   )r  argkeyr   defaults        r8   iter_rich_argsz3traverse.<locals>._traverse.<locals>.iter_rich_argse  s       #C/3x1}.1+UG"e+$!5j(SQ%(
U!5j(SQ!!fIs   AA1"A1,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     K   D ]X  } | j                   s	 t        | j                        }| j                  |t        | j                         r| j                   ndf Z y# t        $ r}| j                  |df Y d}~{d}~ww xY ww)z$Iterate over attr fields and values.N)ru   r  namecallablerC   )attrrN   r  attr_fieldsr0   s      r8   
iter_attrsz/traverse.<locals>._traverse.<locals>.iter_attrs  s      %0 &D#yy
!&,3C,CE )-		(-5=dii5H		d+& %&& (1 !C+/99eT*B$B!Cs-   B	A"5B	"	B+B<B	BB	)r   r   r   r   r   c              3   :   K   | ]  }|j                   s|  y wr   )ru   )r   fields     r8   r   z.traverse.<locals>._traverse.<locals>.<genexpr>  s      -#ejjE-s   )r   r   r   r   )r   r   z... +T)r   r   r   )-idr   r6   r   r   r   r   r   r   rC   r   r   r  list	__class__rx   appendr    r_   r  r   r   r   r9   r<   r   r   r   rD   r
   r)  r  rM   _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   r3  r   r   r   r!  r   
child_noder-  r)  rN   repr_callabler/  container_typer   r   r   	num_itemslast_item_index
iter_itemsindexiter_valuesr,  	_traverserU   rS   pop_visitedpush_visitedr  visited_idss*   `                                 @r8   rH  ztraverse.<locals>._traverseY  sn    C[ 5))9%T1Hey6H	c 	huS%S/=Q7R.S 	 	$%CO 6:30'*'8'8':$ ' c//EBG'789D//J!$#:,d/CD#*U/CD#)*:,a'8(+%-!%&)   $*4Q'7(+%-!%	  &/t_ /	c+C7),JC)25	)JJ.2JO25J/7:J4":.)23eai)HJ.2JO":./ 4;:,a0J<rAR
 S!/ H__F*3/K$cmm.D.D-EU+KLD&)mm&<&<%=Q#?$'!)!	D&c33%*1E(FFG) &$ ?H
>U +::tUM()-]5=Q9R)SJ)25	)JJ*.
.2
+36
0z*+ "%--"8"8!9<rPT $S$/#"3' H__F #--*@*@)A'GH"%--"8"8!9; #% ]]334B7 $- -'-c{- $ 'KD% "+73

+C5ST9!UJ*/**J'&*JO/2J,:&' C %A#%F //J ",U3 !",Q/ #%'L+	 +4CKKM4G4G4I*J '&D,3!*5	!BJ*-J'&*JO/2J,:&' c;/"- #C8-H
  -4X->s-C*JU *S'FG""d3i&8&88ws|$?) +%	 "H	"+a-#C)<=!%ciik!2J!-%+J
%C
/8/D ++|U%.uEAI%F
.5cl
+*/?*B
z*	+ #'s)K!-&,[*&E(1+(> +u%.uEAI%F
*/?*B
z*+ )i*.D4U9z3I2J+KRVWX%"4@73<d;D(e4+C0s  	$#O	$  s$   '\ 8'\ \\	\%$\%T)r  )Fr   )r   r   setaddremover{   r   r   )
r   rS   rT   rU   r   rH  rI  rJ  r  rK  s
    ``` @@@@@r8   traverserO  0  ss    *S S    EK??L$$Kys y$ ys y4 y yv W4(DKr:   r   r   r   r   r   c                r    t        | t              r| }nt        | |||      }|j                  |||      }|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.
    )rS   rT   rU   )r   r   rV   )r_   r   rO  r   )	r   r   r   rS   rT   rU   rV   r   r   s	            r8   r   r   X  sI    8 &
zY
 KK   H Or:   T)rO   rR   rS   rT   rU   rV   c                f    |
t               n|}|j                  t        | |||||d      d       y)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.
    Nignore)rS   rT   rU   rR   rV   rP   T)	soft_wrap)r   rb   rc   )r   rO   rR   rS   rT   rU   rV   _consoles           r8   rs   rs     sD    , !({}WHNN!!'!	
   r:   __main__c                       e Zd ZdefdZy)
BrokenReprr1   c                     ddz   y)Nr   r   zthis will failr   r  s    r8   r>   zBrokenRepr.__repr__  s    E#r:   Nrx   ry   rz   r   r>   r   r:   r8   rW  rW    s    	$c 	$r:   rW  )
NamedTuplec                   F    e Zd ZU eed<   eed<   eed<   eed<   ee   ed<   y)StockKeepingUnitr)  descriptionpricecategoryreviewsN)rx   ry   rz   r   r|   floatr   r   r:   r8   r\  r\    s!    	cr:   r\     foozHello World!gZd;Y@gʡE3t@g    cA>   r   r  r  r   rb           >   r   r  r  crumble)applerhubarbbuttersugarflour)ri  orangepearkumquatrp  X  duriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTNzSparkling British Spring WaterzCarbonated spring waterg?waterzits amazing!zits terrible!)rc  barr   counteratomic
namedtupleBroken)rb   c                       e Zd ZdefdZy)Thingr1   c                      y)NzHello[38;5;239m World!r   r  s    r8   r>   zThing.__repr__  s    /r:   NrY  r   r:   r8   ry  ry    s    	0c 	0r:   ry  )NrR  FFNNNF)NNN)orl   collectionsrA   rG   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+  r4   r   r3   ImportErrorr[   r   _loopr    _pickr!   abcr"   cellsr$   r   r%   jupyterr&   r'   measurer(   r   r)   rO   r*   r+   r,   r-   r.   r/   r{   r9   r<   objectrD   rv  rE   rM   r   r   rf   r6   r_   r   rc   r   r   _Environdict	frozensetr1  rL  r  r   r|   keysr   r6  r   r   r   r  rO  r   rs   rx   rW  rZ  r\  ddatar3  r~   rb   ry  r   r:   r8   <module>r     s       	 
  G G 7 7   "    1t,J      ( 4    6 6 6
@# @(+H"I @
F t " +K**+>C )f ) ), $(!) $ $#+&+&i +& +& 	+&
 +& +& +& }+& +& 39+&\	!&tU49-='=!>	 $(!) $ $#L'i L'L' L' 	L'
 L' L' }L' L' 
L'^e3\ e3PS#X)> 5cSVCW T< TE#sC-4H T
 KKC	 ,=	7
*.C
*.	,	+R>dHcUE#sC-$8899	:  GLLN#R[[*:HE s t  Q Q Qh @ @ @F@ @ @* !% $#	eee e }	e
 
eV	  $ $#%% % 	%
 % % }% % 	%V $( $ $#"" i " 	"
 " " }" " 
"J z$ $
 ":  	CAAeH &
 #"9NO
 	
 &&,%_-
 ,? DB 	Kt&0 0 
&/{ G  Js   -L> >M	M	