
     f&                        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$d
Z%n# e&$ r dZ%Y nw xY wddl'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7 ddl8m9Z9 erddl:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@ dhZAdedeBfdZCdeded         fdZDdeEdeBfdZF ejG        dg           ZHdeEdeBfdZI	 	 	 	 	 	 	 	 dnd!ed"ed#         d$d%d&eBd'eBd(eeJ         d)eeJ         d*eeJ         d+eBddfd,ZKdeEd-e eLeeLd.f         f         deBfd/ZM	 	 	 	 	 	 	 	 dnd"ed#         d$d%d&eBd'eBd(eeJ         d)eeJ         d*eeJ         d+eBddfd0ZN G d1 d2e4          ZOd3eeef         deePePePf         fd4ZQd3d5deePePePf         fd6ZRejS        d7 eeRe
eQed8 ed9 eTd: ed; eUd< eVd= e	d> eWd? eXd@ edA iZYeeLeegeePePePf         f         f         eZdB<    eXeY[                                          Z\eTejS        eefZ]dedeBfdCZ^e G dD dE                      Z_e G dF dG                      Z`dedeBfdHZa	 	 	 dod3ed(eeJ         d)eeJ         d*eeJ         de_f
dIZbdJdKdddddLd3edMeJdNeJd(eeJ         d)eeJ         d*eeJ         d+eBdePfdOZcdd
dddddPd3ed"ed#         d'eBd(eeJ         d)eeJ         d*eeJ         d+eBddfdQZdeedRk    r G dS dT          Zfd dUlmgZg  G dV dWeg          Zh e
eJ          ZidXeidY<   ddZd[d\d]h d^g eUh d_           e
eVd`g dai           eg db          dc ehdddedfdgdhdig           ef            djZjejdY         k                    ej           d dkllmmZm  G dl dm          Zn em eO en                                 dS dS )p    N)array)CounterUserDictUserListdefaultdictdeque)	dataclassfieldsis_dataclass)isclass)islice)MappingProxyType)TYPE_CHECKINGAnyCallableDefaultDictDictIterableListOptionalSequenceSetTupleUnion)RichReprResultTF   get_console)	loop_last)	pick_bool)RichRenderablecell_len)ReprHighlighter)JupyterMixinJupyterRenderable)Measurement)Text)ConsoleConsoleOptionsHighlighterTypeJustifyMethodOverflowMethodRenderResultzmatplotlib.artist.Artistobjreturnc                 R    t           o t          j        t          |                     S )z1Check if an object was created with attrs module.)
_has_attrs_attr_modulehastyper/   s    Z/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/pip/_vendor/rich/pretty.py_is_attr_objectr8   A   s    5,*499555    z_attr_module.Attribute[Any]c                 V    t           r!t          j        t          |                     ng S )zGet fields for an attrs object.)r2   r3   r
   r5   r6   s    r7   _get_attr_fieldsr;   F   s#    -7?<tCyy)))R?r9   c                 d    	 | j         j        j        t          j        k    S # t
          $ r Y dS 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__	Exceptionr6   s    r7   _is_dataclass_reprrC   K   s?    |$0K4HHH   uus   ! 
//_dummy_namedtuplec                     d}	 t          j        | j                  }n# t          t          f$ r Y nw xY wt          j        t
          j                  }||k    S )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	TypeErrorrD   )r/   obj_filedefault_repr_files      r7   _has_default_namedtuple_reprrL   _   sj     H?3<00Y    	  (9(BCC(((s    22ignorevalueconsoler)   overflowr-   cropindent_guides
max_length
max_string	max_depth
expand_allc	                    ddl m}	 ddlm}
 t	          | t
                    s| d S |pt                      }|j        rbg d}|D ]H}t          | |d           }t          j
        |          r!	  |            }n# t          $ r Y ?w xY w| d S I |	| t                    rd S t	          | |
          r|                                 |                    t	          | t                    r| nt!          | ||||||d          |d           d S )	Nr   )is_object_one_of_types)ConsoleRenderable)_repr_html__repr_markdown__repr_json__repr_latex__repr_jpeg_
_repr_png_
_repr_svg__repr_mimebundle_   )rP   rR   rS   rT   rU   rV   marginT)rQ   new_line_start)_inspectrX   rO   rY   _safe_isinstancer&   r   
is_jupytergetattrrF   ismethodrB   JUPYTER_CLASSES_TO_NOT_RENDERlineprintr!   Pretty)rN   rO   rP   rQ   rR   rS   rT   rU   rV   rX   rY   ipython_repr_methodsrepr_methodmethodrepr_results                  r7   _ipy_display_hookrr   s   s    100000****** 011 U]&G 	 
 	 
 	 
 0 	 	KUK66F'' 	"(&((KK    H*FF "!%)FGG 	F 011 MME>22	
'!!!	
 	
 	
       s   +
A66
BBclass_or_tuple.c                 F    	 t          | |          S # t          $ r Y dS w xY w)zFisinstance can fail in rare cases, for example types with no __class__F)
isinstancerB   )r/   rs   s     r7   rf   rf      s9    #~...   uus    
  c           	      2    ddl m  p	               J dt          ddf fd}	 t                      }	ddlm}
  G fdd	|
          } |            }||	j        j        d
<   dS # t          $ r |t          _
        Y dS 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   NrN   r0   c                     | `J dt           _                            t          | t                    r| nt          |                      | t           _        dS dS )z?Replacement sys.displayhook which prettifies objects with Rich.N)rP   rR   rS   rT   rU   rV   )rQ   )builtins_rl   rf   r!   rm   )	rN   rO   rQ   rV   rR   rU   rS   rT   rP   s	    r7   display_hookzinstall.<locals>.display_hook   s    &&&HJMM#E>::
%"/))')        HJJJ# r9   )BaseFormatterc                   @    e Zd ZU dZeed<   dedef fdZdS )install.<locals>.RichFormatterTpprintrN   r0   c           
      n    | j         rt          |                       S t          |          S )N)rO   rP   rR   rS   rT   rU   rV   )r~   rr   repr)	selfrN   rV   r   rR   rU   rS   rT   rP   s	     r7   __call__z'install.<locals>.RichFormatter.__call__  sP    ; ', +!)&3#-#-"+#-	 	 	 	  ;;&r9   N)__name__
__module____qualname__r~   bool__annotations__r   r   )rV   r   rR   rU   rS   rT   rP   s   r7   RichFormatterr}      sq         FD'c 'c ' ' ' ' ' ' ' ' ' ' ' ' ' 'r9   r   z
text/plain)pip._vendor.richr   r   get_ipythonIPython.core.formattersr{   display_formatter
formattersrB   sysdisplayhook)rO   rP   rQ   rR   rS   rT   rU   rV   rz   ipr{   r   rich_formatterr   s   ````````     @r7   installr      sG   0 -,,,,,&GC D             *']]999999	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	'M 	' 	' 	'& '8F'555 ' ' '&'s   AA< <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
dS )$rm   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   rc   insert_line_objecthighlighterr+   r   r   r,   rP   r-   r   rR   rS   rT   rU   rV   rc   r   r0   c                    || _         |pt                      | _        || _        || _        || _        || _        || _        || _        |	| _	        |
| _
        || _        || _        || _        d S N)r   r$   r   r   r   rP   r   rR   rS   rT   rU   rV   rc   r   )r   r   r   r   r   rP   r   rR   rS   rT   rU   rV   rc   r   s                 r7   __init__zPretty.__init__+  st    " &;/*;*;&294<*$$"$&r9   rO   r)   optionsr*   r.   c           	   #     K   t          | j        |j        | j        z
  | j        | j        | j        | j        | j                  }t          j
        || j        p|j        | j        p|j        t          | j        |j                  d          }|r|                     |          n%t          t!          | j                   dd          }| j        r#|j        s|                    | j        d          }| j        rd|v rd	V  |V  d S )
N	max_widthr   rS   rT   rU   rV   pretty)r   rP   r   stylez.__repr__ returned empty stringz
dim italic)r   zrepr.indent
 )pretty_reprr   r   rc   r   rS   rT   rU   rV   r(   	from_ansir   rP   r    r   r   r5   rR   
ascii_onlywith_indent_guidesr   )r   rO   r   
pretty_strpretty_texts        r7   __rich_console__zPretty.__rich_console__J  sH      !L'$+5(n
 
 

 nL3GO]6g&6dlGO<<
 
 
 D[)))%%FFF"   	  	g&8 	%88  9  K  	 3 3HHHr9   r'   c                     t          | j        |j        | j        | j        | j        | j                  }|r+t          d |                                D                       nd}t          ||          S )N)r   r   rS   rT   rV   c              3   4   K   | ]}t          |          V  d S r   r"   .0rk   s     r7   	<genexpr>z*Pretty.__rich_measure__.<locals>.<genexpr>y  s(      CC4CCCCCCr9   r   )
r   r   r   r   rS   rT   rV   max
splitlinesr'   )r   rO   r   r   
text_widths        r7   __rich_measure__zPretty.__rich_measure__m  s     !L'(
 
 

 HRXCCC:+@+@+B+BCCCCCCWX 	 :z222r9   r   )rO   r)   r   r*   r0   r.   )rO   r)   r   r*   r0   r'   )r   r   r   __doc__r   r   intr   r   r   r    r9   r7   rm   rm     sm        , 48'
 -1/3"'#$($(#' !' ' '' /0'
 ' /*' +,' $' ' SM' SM' C=' ' ' '  
!' ' ' '>! !+;!	! ! ! !F3 3+;3	3 3 3 3 3 3r9   rm   r   c                 0    d| j         ddd| j         dfS )Nzdefaultdict(z, {})z, {}))default_factoryr   s    r7   _get_braces_for_defaultdictr   ~  s1    6w.6669w.999 r9   z
array[Any]c                 0    d| j         ddd| j         dfS )Nzarray(z, [])))typecoder   s    r7   _get_braces_for_arrayr     s,    ,W%,,,d4RW=M4R4R4RSSr9   c                     dS )N)z	environ({r   zenviron({})r   r   s    r7   <lambda>r     s    !C r9   c                     dS )N)z	Counter({r   z	Counter()r   r   s    r7   r   r     s    = r9   c                     dS )N)zdeque([r   zdeque()r   r   s    r7   r   r     s    7 r9   c                     dS N){}z{}r   r   s    r7   r   r         * r9   c                     dS r   r   r   s    r7   r   r         . r9   c                     dS )N)zfrozenset({r   zfrozenset()r   r   s    r7   r   r     s    C r9   c                     dS N)[]z[]r   r   s    r7   r   r     r   r9   c                     dS r   r   r   s    r7   r   r     r   r9   c                     dS )N)r   r   zset()r   r   s    r7   r   r     s    , r9   c                     dS )N)(r   ()r   r   s    r7   r   r     s    + r9   c                     dS )N)zmappingproxy({r   zmappingproxy({})r   r   s    r7   r   r     s    &R r9   _BRACESc                     t          | t                    p-t          |           pt          | d          pt	          |           ot          |            S )z3Check if an object may be expanded by pretty print.__rich_repr__)rf   _CONTAINERSr   hasattrr8   r   r6   s    r7   is_expandabler     s]     	k** 	 	 C))	  3	
 cll
r9   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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dS )Nodez4A node in a repr tree. May be atomic or a container.r   key_repr
value_repr
open_braceclose_braceemptyFlastis_tupleis_namedtupleNchildrenz: z, 	separatorr0   c              #     K   | j         r| j         V  | j        V  | j        r| j        V  dS | j        | j        r| j        V  | j        rI| j        sBt          | j                  dk    r*| j        d                                         E d{V  dV  n4| j        D ],}|                                E d{V  |j	        s	| j
        V  -| j        V  dS | j        V  dS dS )zGenerate tokens for this node.Nr   r   ,)r   key_separatorr   r   r   r   r   leniter_tokensr   r   r   r   )r   childs     r7   r   zNode.iter_tokens  sI     = 	%-$$$$? 	!/!!!!!]&} !o%%%= 1); 1DM@R@RVW@W@W#}Q/;;=========IIII!% 1 1#(#4#4#6#66666666$z 1"&.000&&&&&&j      '&r9   start_lengthrS   c                 n    |}|                                  D ]}|t          |          z  }||k    r dS 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   rS   total_lengthtokens        r7   check_lengthzNode.check_length  sP     $%%'' 	 	EHUOO+Lj((uu )tr9   c                 T    d                     |                                           }|S Nr   )joinr   )r   	repr_texts     r7   __str__zNode.__str__  s%    GGD,,..//	r9   P   r   r   r   rV   c                 V   t          | d          g}d}|t          |          k     rb||         }|j        r;|j        s4|s|                    |          s|                    |          |||dz   <   |dz  }|t          |          k     bd                    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   4   K   | ]}t          |          V  d S r   )strr   s     r7   r   zNode.render.<locals>.<genexpr>  s(      994SYY999999r9   )_Liner   
expandableexpandedr   expandr   )r   r   r   rV   linesline_nork   repr_strs           r7   renderzNode.render  s     D$///0E

"">D Lt} L LT%6%6y%A%A L37;;{3K3KE'GaK/0qLG E

"" 9999599999r9   )r   r   F)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   r9   r7   r   r     sj        >>HcJJKE3OOOD$HdM4'+HhtF|$+++MIs!Xc] ! ! ! !, # $    "    
 MR 03EI	     r9   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dS )r  zA line in repr output.NparentFr   r   r   textsuffix
whitespacer  r   r0   c                 F    t          | j        duo| j        j                  S )z"Check if the line may be expanded.N)r   r   r   r   s    r7   r  z_Line.expandable	  s#     DIT)@di.@AAAr9   rS   c                     t          | j                  t          | j                  z   t          | j                  z   }| j        J | j                            ||          S )z4Check this line fits within a given number of cells.)r   r  r#   r  r  r   r   )r   rS   r   s      r7   r   z_Line.check_length  s\       8DI#6#66$+9N9NN 	 y$$$y%%lJ???r9   r   c              #     K   | j         }|J | j        }|j        sJ |j        r)t	          |j         |j         |j         |          V }nt	          |j        |          V }| j        d|z  z   }|j        ot          |j                  dk    }t          |j                  D ]+\  }}|rdn|j
        }	t	          ||||	|o|           }
|
V  ,t	          |j        || j        | j                  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   r   r   r  new_linechild_whitespacetuple_of_oner   r   r   rk   s              r7   r  z_Line.expand  sb     y_
}= 	P"Lt'9L4?LL%    HH
 #JOOOOOH?S;->>}@T]););q)@$T]33 		 		KD%+?I+ .,.  D JJJJ!!;	
 
 
 	
 	
 	
 	
 	
r9   c                     | j         r| j         | j         | j        pd S | j         | j         | j        pd | j                                         S r   )r   r  r  r   r  rstripr  s    r7   r   z_Line.__str__7  sc    9 	oCtyC$)/rCCC ?VDIVtyBV@R@R@T@TVVr9   )r   r   r   r   r
  r   r   r   r   r   r   r  r   r  r  r  r   propertyr  r   r   r   r  r   r   r9   r7   r  r    s7           $FHW$$$GTD(4.D#NNNFCJHdD$BD B B B XB@s @t @ @ @ @
# 
(7*; 
 
 
 
B      r9   r  c                     	 t          | dd          }n# t          $ r Y dS w xY wt          | t                    ot          |t                    S )aX  Checks if an object is most likely a namedtuple. It is possible
    to craft an object that passes this check and isn't a namedtuple, but
    there is only a minuscule chance of this happening unintentionally.

    Args:
        obj (Any): The object to test

    Returns:
        bool: True if the object is a namedtuple. False otherwise.
    _fieldsNF)rh   rB   ru   tuple)r/   r
   s     r7   _is_namedtupler  @  s]    i..   uu c5!!?j&?&??s    
""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.
    r/   r0   c                 $   Qt          | t          t          f          r5t          |           k    r"t          |           z
  }| d         d| }n;	 t	          |           }n*# t
          $ r}dt          |          d}Y d}~nd}~ww xY w|S )z0Get repr string for an object, but catch errors.N+z<repr-error >)rf   bytesr   r   r   rB   )r/   	truncatedobj_reprerrorrT   s       r7   to_reprztraverse.<locals>.to_reprh  s     " ucl33 #C:%%C:-Ikzk*::y::HH:99 : : :9#e**999:s   A& &
B0BBFr   rootdepthc           	      l   # t                     }|*v rt          d          S t                     }t          j        j        t          j        j        f}%duo|%k    }dt          dt          t          t          t          t          t          f         f                  fd}	 t           d          }n# t          $ r d}Y nw xY wd}	|sE	 t           d	          r#t                     s                                 }	n# t          $ r Y nw xY w|	[ (|           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 ]r\  }}t-          |t.                    r6|\  }} $||dz             }||_        ||_        d|_         ||           P $||dz             }||_         ||           snt          |
rd| dn| dg |          } '|           nt7                     r`|s] (|           g }|j        }t9                     ##r|rt           j        j         d          }n	t           j        j         dd||          }dt          t          t          t          t:          t<          t          gt          f                  f                  f# fd}t+           |                      D ]b\  }\  }}}|r't          t           ||                              }n $||dz             }||_        ||_        d|_         ||           cnt           j        j         dg |          } '|           n(t?                     rt-           t                    s|stA                     s|dk    r (|           g }|j        }|rt           j        j         d          }nt           j        j         dd||          }t+          d tC                     D                       D ]M\  }} $t!           |j"                  |dz             }|j"        |_        ||_        d|_         ||           N '|           ntG                     rtI                     r (|            j        j        }|rt          | d          }ng }|j        }t          | dd|| d          }t+           %                                &                                          D ]8\  }\  }} $||dz             }||_        ||_        d|_         ||           9 '|           n1t-           tN                    rtN          D ]}t-           |          r|} n (|           tQ          |                    \  }}}|rt          | d|           }n|j)        t                     j)        k    rt           )           |          }na rLg }t          ||||          }|j        }tU                     }|dz
  }t-           tV                    rtY           &                                          } &t[          | &          } t]          |           D ]>\  }!\  }} $||dz             } )|          |_        |!|k    |_         ||           ?n\tY                     }"&t[          |"&          }"t]          |"          D ]+\  }!} $||dz             }|!|k    |_         ||           ,&&|&k    r  |t          d|&z
   d                     nt          |g |           } '|           nt           )           |          }t-           t.                    |_/        tG                     |_0        |S )!zWalk the object depth first.z...)r   N	rich_argsr0   c              3     K   | D ]}t          |t                    rdt          |          dk    r|\  }}}||k    r7||fV  >t          |          dk    r|\  }}||fV  ]t          |          dk    r
|d         V  {|V  d S )N      r   r   )rf   r  r   )r)  argkeyr   defaults        r7   iter_rich_argsz3traverse.<locals>._traverse.<locals>.iter_rich_args  s         #C// 3xx1}}.1+UG"e++$!5j((((SQ%(
U!5j((((SQ!!fIIII r9   ,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 ]j} | j         ra	 t          | j                  }| j        |t          | j                   r| j         ndfV  G# t          $ r}| j        |dfV  Y d}~bd}~ww xY wkdS )z$Iterate over attr fields and values.N)r   rh   namecallablerB   )attrrN   r$  attr_fieldsr/   s      r7   
iter_attrsz/traverse.<locals>._traverse.<locals>.iter_attrs  s       %0 & &D#y &
!&,3C,C,CE )-	(-5=di5H5H(R		d+& %& %& %& %&	 (1 !C !C !C+/9eT*B$B$B$B$B$B$B$B$B!C&& &s   A
A-A((A-)r+     c              3   (   K   | ]}|j         	|V  d S r   )r   )r   fields     r7   r   z.traverse.<locals>._traverse.<locals>.<genexpr>  s=       - -#ej-- - - - - -r9   )r   r   r   r   )r   r   z... +T)r   r   r   )1idr   r5   r   version_infomajorminorr   r   r   r   r   r   rB   r   r   rh   list	__class__r   appendr   rf   r  r   r   r   r8   r;   r   r   r   rC   r
   r6  r  rL   _asdictitemsr   r   r=   r   _MAPPING_CONTAINERSiterr   	enumerater   r   )+r/   r&  r'  obj_idobj_type
py_versionreached_max_depthr0  fake_attributesrich_repr_resultr2  args
class_namer   rD  r   r   r-  r.  r   
child_noder:  r6  rN   repr_callabler=  container_typer   r   r   	num_itemslast_item_index
iter_itemsindexiter_valuesr9  	_traverserU   rS   pop_visitedpush_visitedr%  visited_idss+   `                                  @r7   rZ  ztraverse.<locals>._traverse|  s
    C[  5))))99&,c.>.DE
%T1Hey6H	c 	huS%S/=Q7R.S 	 	 	 	 	$%C OO  	$ 	$ 	$#OOO	$ 6: 	300 ; ;'*'8'8':':$    'L   c/EBBG'78899D/J *!$  / E#/C:/C/C/CDDD#*/C/C/CDDD #'8:'8'8'8(+%-!%&)       $*4'7'7'7(+%-!%	      &/t__ / /	c+C77 
/),JC)25	)J)J)JJ.2JO25J/7:J4"F:....)23eai)H)H)HJ.2JO"F:..../ 4;R0:0000JARARAR  
 KS!! X	</ X	<L   H_F*3//K )$ $+cm.D+K+K+KLLLDD&)m&<#?#?#?$'!)!	  D&c33%*1E(FFG) & & & & & & &$ ?H

>U>U + +::tUM( K)-]]5=Q=Q9R9R)S)S)SJJ)25	)J)J)JJ*.
.2
+36
0z****+ "%-"8<<<rPT   Kg	<$S$//g	< $g	< $C((	g	< -7&,@,@L   H_F  '#-*@'G'G'GHHH"%-"8;;; #%	   $- - -'-c{{- - - $ $ ' 'KD% "+73
+C+C5ST9!U!U!UJ*/*J'&*JO/2J,F:&&&&KC   J	<%A#%F%F J	<L   /J  '",333   !",/// #%'+++	   +4CKKMM4G4G4I4I*J*J ' '&D,3!*5	!B!B!BJ*-J'&*JO/2J,F:&&&&Kc;// 2	<"-  #C88 -HE L   -4X->s-C-C*JU  $A*'F'F'F'FGGG"d3ii&888wws||$???  A) +%	   "HH	"+a-#C)<== +!%ciikk!2!2J!-%+J
%C%C
/8/D/D + ++|U%.YuEAI%F%F%F
.5gcll
+*/?*B
z****	+ #'s))K!-&,[*&E&E(1+(>(> + +u%.YuEAI%F%F%F
*/?*B
z****)i*.D.DF4+K9z3I+K+KRVWWWXXX%"4@@@K773<<d;;;D(e44+C00s$   $B5 5CC3D   
DDT)r&  )Fr   )r   r   setaddremover   r   r   )
r   rS   rT   rU   r   rZ  r[  r\  r%  r]  s
    ``` @@@@@r7   traversera  S  s    *S S         EEK?L$Ky ys y$ ys y4 y y y y y y y y y y y yv 9W4(((DKr9   r   r   r   r   r   c                    t          | t                    r| }nt          | |||          }|                    |||          }|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   )rf   r   ra  r  )	r   r   r   rS   rT   rU   rV   r   r  s	            r7   r   r   {  sb    8 && 

zY
 
 
 KK    H Or9   )rO   rR   rS   rT   rU   rV   c                    |t                      n|}|                    t          | |||||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.
    NrM   )rS   rT   rU   rR   rV   rP   T)	soft_wrap)r   rl   rm   )r   rO   rR   rS   rT   rU   rV   _consoles           r7   r~   r~     sf    , !({}}}WHNN!!'!	
 	
 	
       r9   __main__c                       e Zd ZdefdZdS )
BrokenReprr0   c                     ddz   dS )Nr   r   zthis will failr   r  s    r7   r=   zBrokenRepr.__repr__  s    EE##r9   Nr   r   r   r   r=   r   r9   r7   rh  rh    s/        	$c 	$ 	$ 	$ 	$ 	$ 	$r9   rh  )
NamedTuplec                   N    e Zd ZU eed<   eed<   eed<   eed<   ee         ed<   dS )StockKeepingUnitr6  descriptionpricecategoryreviewsN)r   r   r   r   r   floatr   r   r9   r7   rm  rm    sI         			cr9   rm     foozHello World!gZd;Y@gʡE3t@g    cA>   r   r,  r+  r   rs  r;        >   r   r,  r+  crumble)applerhubarbbuttersugarflour)ry  orangepearkumquatr  X  duriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurianduriandurian)FTNzSparkling British Spring WaterzCarbonated spring waterg?waterzits amazing!zits terrible!)rt  barr   counteratomic
namedtupleBroken)rl   c                       e Zd ZdefdZdS )Thingr0   c                     dS )NzHello[38;5;239m World!r   r  s    r7   r=   zThing.__repr__  s    //r9   Nrj  r   r9   r7   r  r    s/        	0c 	0 	0 	0 	0 	0 	0r9   r  )NrM   FFNNNF)NNN)orx   collectionsr@   rF   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   r8  r3   r2   ImportErrorr   r   _loopr   _pickr    abcr!   cellsr#   r   r$   jupyterr%   r&   measurer'   r  r(   rO   r)   r*   r+   r,   r-   r.   rj   r   r8   r;   objectrC   r  rD   rL   r   rr   r5   rf   r   rm   r   r   r   _Environdict	frozensetrB  r^  r  r   r   keysr   rG  r   r   r  r  ra  r   r~   r   rh  rk  rm  ddatarD  r   rl   r  r   r9   r7   <module>r     s
             				 



       G G G G G G G G G G G G G G 7 7 7 7 7 7 7 7 7 7             " " " " " "                            1 0 0 0 0 0JJ   JJJ                               ( ( ( ( ( ( 4 4 4 4 4 4 4 4                                   ! 6 6 6 6 6 6
@# @(+H"I @ @ @ @
F t    " +K*+>CC )f ) ) ) ) ), $(!) $ $#H HHi H H 	H
 H H H }H H 
H H H HV	!&tU49-='=!>	    $(!) $ $#L' L'i L'L' L' 	L'
 L' L' }L' L' 
L' L' L' L'^d3 d3 d3 d3 d3\ d3 d3 d3NS#X)> 5cSVCW    T< TE#sC-4H T T T T
 KCC	 ,==	77
*
*..CC
*
*..	,	,	++RR>dHcUE#sC-$8899	:    eGLLNN##R[*:HE s t     Q Q Q Q Q Q Q Qh @ @ @ @ @ @ @ @F@ @ @ @ @ @* !% $#	e eee e }	e
 
e e e eV	  $ $#% % %% % 	%
 % % }% % 	% % % %V $( $ $#" " "" i " 	"
 " " }" " 
" " " "J z$ $ $ $ $ $ $ $
 "!!!!!    :    	CAAeH &&&
 y##"{9NNNO
 
 7  	
 	
 &&&,%_-
 
 *,,?   DB 	Kt&&&&&&0 0 0 0 0 0 0 0 
E&&//{ s   -A4 4A>=A>