
    ,h                        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$ 	 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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ZEdeded   fdZFdeGdeDfdZH ej                  dg       ZJdeGdeDfdZK	 	 	 	 	 	 	 	 doded ed!   d"d#d$eDd%eDd&eeL   d'eeL   d(eeL   d)eDde"eMdf   fd*ZNdeGd+e"eOe!eOd,f   f   deDfd-ZP	 	 	 	 	 	 	 	 dod ed!   d"d#d$eDd%eDd&eeL   d'eeL   d(eeL   d)eDddfd.ZQ G d/ d0e7      ZRd1eeef   de!eMeMeMf   fd2ZSd1ee   de!eMeMeMf   fd3ZTd1d4de!eMeMeMf   fd5ZUej                  d6 eeUeeSed7 eeTeWd8 e	d9 eXd: eYd; e
d< eZd= e[d> ed? iZ\eeOeege!eMeMeMf   f   f   e]d@<    e[e\j                               Z_eWej                  ee	fZ`dedeDfdAZae G dB dC             Zbe G dD dE             ZcdedeDfdFZd	 	 	 dpd1ed&eeL   d'eeL   d(eeL   debf
dGZedHdIdddddJd1edKeLdLeLd&eeL   d'eeL   d(eeL   d)eDdeMfdMZfddNdddddOd1ed ed!   d%eDd&eeL   d'eeL   d(eeL   d)eDddfdPZgehdQk(  r G dR dS      Zid dTlmjZj  G dU dVej      Zk eeL      ZldWeldX<   ddYdZd[d\h d]g eXh d^       eeYd_g d`i       eg da      db ekdcdddedfdgdhg       ei       diZmemdX   j                  em       d djlompZp  ep eRemdNdkl              G dm dn      Zq ep eR eq                    yy# e)$ r dZ(Y w xY w)q    N)array)CounterUserDictUserListdefaultdictdeque)	dataclassfieldsis_dataclass)isclass)islice)MappingProxyType)TYPE_CHECKINGAnyCallableDefaultDictDequeDictIterableListOptionalSequenceSetTupleUnion)RichReprResultibF   get_console)	loop_last)	pick_bool)RichRenderablecell_len)ReprHighlighter)JupyterMixinJupyterRenderable)Measurement)Text)ConsoleConsoleOptionsHighlighterTypeJustifyMethodOverflowMethodRenderResultobjreturnc                 N    t         xr t        j                  t        |             S )z1Check if an object was created with attrs module.)
_has_attrs_attr_modulehastyper1   s    M/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/rich/pretty.py_is_attr_objectr:   <   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.)r4   r5   r
   r7   r8   s    r9   _get_attr_fieldsr=   A   s    -7<tCy)?R?r;   c                     	 | j                   j                  j                  t        j                  t
        j                  fv 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__reprlib	Exceptionr8   s    r9   _is_dataclass_reprrF   F   sO    ||$$00  5
 
 	
  s   ?A 	AA_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	TypeErrorrG   )r1   obj_filedefault_repr_files      r9   _has_default_namedtuple_reprrO   ]   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   )rR   rT   rU   rV   rW   rX   marginT )rS   new_line_startend
)rQ   rZ   _safe_isinstancer(   r    capturelineprintr#   Prettygetrstrip)rP   rQ   rR   rS   rT   rU   rV   rW   rX   rZ   rb   s              r9   _ipy_display_hookrh   q   s     + 01U]&G		 
gE#45LLN $E>: %"/))')	 # 	 	
	
2 ;;=%%3
 
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)
isinstancerE   )r1   ri   s     r9   ra   ra      s&    #~.. s    	c           	      &    ddl m  xs           J dt        ddf fd}	 t               }	ddlm}
  G fdd	|
      } |       }||	j                  j                  d
<   y# t        $ r |t        _
        Y yw xY 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.
        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   NrP   r2   c                     | PJ dt         _        j                  t        | t              r| nt        |              | t         _        yy)z?Replacement sys.displayhook which prettifies objects with Rich.N)rR   rT   rU   rV   rW   rX   )rS   )builtins_rd   ra   r#   re   )	rP   rQ   rS   rX   rT   rW   rU   rV   rR   s	    r9   display_hookzinstall.<locals>.display_hook   sk    &&HJMM (~> !)&3#-#-"+#-     HJ' r;   )BaseFormatterc                   >    e Zd ZU dZeed<   dedef fdZy)install.<locals>.RichFormatterTpprintrP   r2   c           
      b    | j                   rt        |              S t        |      S )N)rQ   rR   rT   rU   rV   rW   rX   )rt   rh   repr)	selfrP   rX   r    rT   rW   rU   rV   rR   s	     r9   __call__z'install.<locals>.RichFormatter.__call__   s=    ;;, +!)&3#-#-"+#-	 	  ;&r;   N)__name__
__module____qualname__rt   bool__annotations__r   rx   )rX   r    rT   rW   rU   rV   rR   s   r9   RichFormatterrs      s%    FD'c 'c ' 'r;   r~   z
text/plain)richr    r   get_ipythonIPython.core.formattersrq   display_formatter
formatters	NameErrorsysdisplayhook)rQ   rR   rS   rT   rU   rV   rW   rX   rp   iprq   r~   rich_formatterr    s   ````````     @r9   installr      s    0 !&GC D  .G] 	:	' 	'M 	'& '8F''53  '&'s   
A9 9BB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)re   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justifyrR   no_wraprT   rU   rV   rW   rX   r\   insert_line_objecthighlighterr-   r   r   r.   rR   r/   r   rT   rU   rV   rW   rX   r\   r   r2   c                    || _         |xs
 t               | _        || _        || _        || _        || _        || _        || _        |	| _	        |
| _
        || _        || _        || _        y N)r   r&   r   r   r   rR   r   rT   rU   rV   rW   rX   r\   r   )rw   r   r   r   r   rR   r   rT   rU   rV   rW   rX   r\   r   s                 r9   __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   rU   rV   rW   rX   pretty)r   rR   r   stylez.__repr__ returned empty stringz
dim italic)r   zrepr.indentr`   r]   )pretty_reprr   r   r\   r   rU   rV   rW   rX   r*   	from_ansir   rR   r"   r   r   r7   rT   
ascii_onlywith_indent_guidesr   )rw   rQ   options
pretty_strpretty_texts        r9   __rich_console__zPretty.__rich_console__0  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$   .0rc   s     r9   	<genexpr>z*Pretty.__rich_measure__.<locals>.<genexpr>`  s     C4C   r   )r   r   r   r   rU   rV   rW   rX   max
splitlinesr)   )rw   rQ   r   r   
text_widths        r9   __rich_measure__zPretty.__rich_measure__S  sw     !LL''((nn

 HRCC:+@+@+BCCWX 	 :z22r;   r   )rQ   r+   r   r,   r2   r0   )rQ   r+   r   r,   r2   r)   )ry   rz   r{   __doc__r   r   intr|   r   r   r    r;   r9   re   re      s   , 48'
 -1/3"'#$($(#' !'' /0'
 ' /*' +,' $' ' SM' SM' C=' ' ' '  
!'>! !+;!	!F3 3+;3	3r;   re   r   c                 D    d| j                   ddd| j                   dfS )Nzdefaultdict(z, {})z, {}))default_factoryr   s    r9   _get_braces_for_defaultdictr   e  s5    
w..16
w..19 r;   c                 ^    | j                   ydd| j                    dd| j                    dfS )N)deque([])zdeque()r   z
], maxlen=)zdeque(maxlen=)maxlenr   s    r9   _get_braces_for_dequer   m  s>    ~~+
W^^$A&
'q) r;   z
array[Any]c                 D    d| j                   ddd| j                   dfS )Nzarray(z, [r   r   )typecoder   s    r9   _get_braces_for_arrayr   w  s0    W%%(,dfW=M=M<PPQ4RSSr;   c                      y)N)z	environ({r   zenviron({})r   r   s    r9   <lambda>r   |      r;   c                      y)N)z	Counter({r   z	Counter()r   r   s    r9   r   r     r   r;   c                      yN){}z{}r   r   s    r9   r   r     r   r;   c                      yr   r   r   s    r9   r   r     r   r;   c                      y)N)zfrozenset({r   zfrozenset()r   r   s    r9   r   r     r   r;   c                      yN)[]z[]r   r   s    r9   r   r     r   r;   c                      yr   r   r   s    r9   r   r     r   r;   c                      y)N)r   r   zset()r   r   s    r9   r   r     r   r;   c                      y)N)(r   ()r   r   s    r9   r   r     r   r;   c                      y)N)zmappingproxy({r   zmappingproxy({})r   r   s    r9   r   r     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__)ra   _CONTAINERSr   hasattrr:   r   r8   s    r9   is_expandabler     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, 	separatorr2   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   )rw   childs     r9   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_lengthrU   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%   )rw   r   rU   total_lengthtokens        r9   check_lengthzNode.check_length  s?     $%%' 	EHUO+Lj(	 r;   c                 D    dj                  | j                               }|S Nr]   )joinr   )rw   	repr_texts     r9   __str__zNode.__str__  s    GGD,,./	r;   r   r   rX   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     r9   r   zNode.render.<locals>.<genexpr>  s     94SY9r   )_Liner   
expandableexpandedr   expandr   )rw   r   r   rX   linesline_norc   repr_strs           r9   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)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   r;   r9   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   r2   c                 `    t        | j                  duxr | j                  j                        S )z"Check if the line may be expanded.N)r|   r   r   rw   s    r9   r   z_Line.expandable  s'     DIIT)@dii.@.@AAr;   rU   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   )rw   rU   r   s      r9   r   z_Line.check_length  sW      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   )rw   r   r   r  new_linechild_whitespacetuple_of_oner   r   r   rc   s              r9   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  rg   r  s    r9   r   z_Line.__str__(  si    99oo&tyyk$))/r1BCC ??#DII;tyyB.?@R@R@T?UVr;   )ry   rz   r{   r   r  r   r}   r   r|   r   r   r  r   r  r  r   r   propertyr   r   r   r   r   r   r   r;   r9   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)getattrrE   rk   tuple)r1   r
   s     r9   _is_namedtupler  1  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.
    r1   r2   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 >)ra   bytesr   r   rv   rE   )r1   	truncatedobj_reprerrorrV   s       r9   to_reprztraverse.<locals>.to_reprY  s     " ucl3C:%C:-Ikz*-Qyk:H 	:9   :)#e*q9:s   A 	A3A..A3rootdepthc           	      X   " 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#         f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&        k(  |_+        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_argsr2   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   )ra   r  r   )r!  argkeyr   defaults        r9   iter_rich_argsz3traverse.<locals>._traverse.<locals>.iter_rich_argsy  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)rv   r  namecallablerE   )attrrP   r  attr_fieldsr1   s      r9   
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   f   K   | ](  }|j                   rt        |j                        r| * y wr   )rv   r   r.  )r   fieldr1   s     r9   r   z.traverse.<locals>._traverse.<locals>.<genexpr>  s-      -zzgc5::&> -s   .1)r   r   r   r   )r   r   z... +T)r   r   r   )-idr   r7   r   r   r   r   r   r   rE   r   r   r  list	__class__ry   appendr!   ra   r  r   r   r   r:   r=   r   r   r   rF   r
   r.  r  rO   _asdictitemsr   r   r?   r   _MAPPING_CONTAINERSiterr   	enumerater   r   )*r1   r  r  obj_idobj_typereached_max_depthr(  fake_attributesrich_repr_resultr*  args
class_namer   r8  r   r   r%  r&  r   
child_noder2  r.  rP   repr_callabler4  container_typer   r   r   	num_itemslast_item_index
iter_itemsindexiter_valuesr1  	_traverserW   rU   pop_visitedpush_visitedr  visited_idss*   `                                 @r9   rM  ztraverse.<locals>._traversem  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& sC(C5#::N1O'O!PQ&$ ?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 $- -!'- $ 	'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S	U*+C0w  	$#O	$  s$   '\
 8'\ 
\\	\)(\)T)r  )Fr   )r   r   setaddremover|   r   r   )
r   rU   rV   rW   r   rM  rN  rO  r  rP  s
    ``` @@@@@r9   traverserT  D  ss    *S S    EK??L$$K{s {$ {s {4 { {z 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.
    )rU   rV   rW   )r   r   rX   )ra   r   rT  r   )	r   r   r   rU   rV   rW   rX   r   r   s	            r9   r   r   n  sI    8 &
zY
 KK   H Or;   T)rQ   rT   rU   rV   rW   rX   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)rU   rV   rW   rT   rX   rR   T)	soft_wrap)r    rd   re   )r   rQ   rT   rU   rV   rW   rX   _consoles           r9   rt   rt     sD    , !({}WHNN!!'!	
   r;   __main__c                       e Zd ZdefdZy)
BrokenReprr2   c                     ddz   y)Nr   r   zthis will failr   r  s    r9   r?   zBrokenRepr.__repr__  s    E#r;   Nry   rz   r{   r   r?   r   r;   r9   r\  r\    s    	$c 	$r;   r\  )
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)ry   rz   r{   r   r}   floatr   r   r;   r9   ra  ra    s!    	cr;   ra     foozHello World!gZd;Y@gʡE3t@g    cA>   r   r$  r#  r   rg           >   r   r$  r#  crumble)applerhubarbbuttersugarflour)rn  orangepearkumquatru  X  duriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTNzSparkling British Spring WaterzCarbonated spring waterg?waterzits amazing!zits terrible!)rh  barr   counteratomic
namedtupleBroken)rd      )rT   rV   c                       e Zd ZdefdZy)Thingr2   c                      y)NzHello[38;5;239m World!r   r  s    r9   r?   zThing.__repr__  s    /r;   Nr^  r   r;   r9   r  r    s    	0c 	0r;   r  )NrW  FFNNNF)NNN)rrn   collectionsrB   rI   osrD   r   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   	rich.reprr   r0  r5   r   r4   ImportErrorr]   r    _loopr!   _pickr"   abcr#   cellsr%   r   r&   jupyterr'   r(   measurer)   r  r*   rQ   r+   r,   r-   r.   r/   r0   r|   r:   r=   objectrF   r{  rG   rO   r   r   rh   r7   ra   r   re   r   r   r   _Environdict	frozensetr6  rQ  r  r   r}   keysr   r;  r   r   r   r  rT  r   rt   ry   r\  r_  ra  ddatar8  r   rd   r  r   r;   r9   <module>r     s-       	  
  G G 7 7   "     %t,J      ( 4    6 6 6
@# @(+H"I @
F t ( +K**+>C )f ) ), $(!) $ $#-&-&i -& -& 	-&
 -& -& -& }-& -& 39-&`	!&tU49-='=!>	 $(!) $ $#OGi OGOG OG 	OG
 OG OG }OG OG 
OGde3\ e3PS#X)> 5cSVCW 5: %S#2F T< TE#sC-4H T
 KKC	 ,=	 
*.C
*.	,	+R>dHcUE#sC-$8899	:  GLLN#R[[*:HE s t  Q Q Qh @ @ @F@ @ @* !% $#	ggg g }	g
 
gZ	  $ $#%% % 	%
 % % }% % 	%V $( $ $#"" i " 	"
 " " }" " 
"J z$ $
 ":  	CAAeH &
 #"9NO
 	
 &&,%_-
 ,? DB 	Kt	&Tb
9:0 0 
&/{ o  Js   3M% %M0/M0