
    MhF                       S r SSKJr  SSKJrJrJr  SSKrSSKJ	r	J
r
JrJr  SSKJr  SSKJr  SSKJr  SS	KJr  \\\\4   \\   4   r\" S
5      r\" S5      rSS jrSSS jjr S        S!S jjr S        S"S jjr     S#             S$S jjr S%     S&S jjrS'S jrS(S)S jjr     S*           S+S jjr!      S,S jr" " S S\#\\4   5      r$ " S S5      r% " S S\%5      r&S-S jr'g).z
Printing tools.
    )annotations)IterableMappingSequenceN)AnyCallableTypeVarUnion)east_asian_width)
get_option)is_sequence)get_console_size_KT_VTc           	        UR                  S[        5      nUR                  S[        5      n/ nUSS  Vs/ s H  n[        [	        X65      5      U -   PM     nnUR                  [        [	        [        US   5      5      5        [        [	        [        U5      5      n[        U5       H:  u  pU" XU	   SS9nSXy   -  /U[        U
5      -
  -  U-   nUR                  U5        M<     [        U6 nSR                  S	 U 5       5      $ s  snf )
a  
Glues together two sets of strings using the amount of space requested.
The idea is to prettify.

----------
space : int
    number of spaces for padding
lists : str
    list of str which being joined
strlen : callable
    function used to calculate the length of each str. Needed for unicode
    handling.
justfunc : callable
    function used to justify str. Needed for unicode handling.
strlenjustfuncNleft)mode 
c              3  D   #    U  H  nS R                  U5      v   M     g7f) N)join).0liness     L/var/www/html/env/lib/python3.13/site-packages/pandas/io/formats/printing.py	<genexpr>adjoin.<locals>.<genexpr><   s     8RWWU^^s    )	poplen_adj_justifymaxmapappend	enumeratezipr   )spacelistskwargsr   r   newListsxlengthsmaxLenilstnltoJoins                r   adjoinr4      s      ZZ#&Fzz*l3HH49#2J?Jqs3v>"U*JG?NN3s3b	*+,S%!FE"c1:F3WZ FSX$56"< # (^F998888 @s   !Dc                    US:X  a!  U  Vs/ s H  o3R                  U5      PM     sn$ US:X  a!  U  Vs/ s H  o3R                  U5      PM     sn$ U  Vs/ s H  o3R                  U5      PM     sn$ s  snf s  snf s  snf z:
Perform ljust, center, rjust against string or list-like
r   centerljustr7   rjust)textsmax_lenr   r-   s       r   r#   r#   ?   sr     v~*/0%Q %00		+015a!511*/0%Q %00	 110   A0A5A:c                4   [        U [        5      (       a  SnO[        U S5      (       a  SOSnUSL a  [        U 5      nO&U=(       d    [	        S5      =(       d    [        U 5      n[        U 5      n[        [        U[        U 5      5      5       Vs/ s H  n[        [        U5      US-   4SU0UD6PM      nnSR                  U5      n	U[        U 5      :  a  U	S	-  n	O)[        U [        5      (       a  [        U 5      S:X  a  U	S
-  n	UR                  U	S9$ s  snf )z
internal. pprinter for iterables. you should probably use pprint_thing()
rather than calling this directly.

bounds length of printed sequence, depending on options
z
{{{body}}}__setitem__z[{body}]z({body})Fmax_seq_items   , , ...,)body)
isinstancesethasattrr"   r   iterrangeminpprint_thingnextr   tupleformat)
seq	_nest_lvlr@   kwdsfmtnitemssr0   rrE   s
             r   _pprint_seqrW   c   s     #s#C77jZSI*_"=ISS	A s63s8,-	-A 	T!Wi!mQ=QDQ-  	 99Q<DC	C		CHM::4:  	s   %Dc                   Sn/ nSnUSL a  [        U 5      nO&U=(       d    [        S5      =(       d    [        U 5      n[        U R                  5       5      SU  HB  u  pUR	                  UR                  [        XS-   4SU0UD6[        XS-   4SU0UD6S95        MD     U[        U 5      :  a!  UR                  SR                  U5      S	-   S
9$ UR                  SR                  U5      S
9$ )zm
internal. pprinter for iterables. you should probably use pprint_thing()
rather than calling this directly.
z{{{things}}}z{key}: {val}Fr@   NrA   )keyvalrB   rC   )things)r"   r   listitemsr&   rO   rL   r   )
rP   rQ   r@   rR   rS   pairspfmtrT   kvs
             r   _pprint_dictrb      s     CEDSI*_"=ISSYY[!'6*KK MWWRVW MWWRVW  	
 + Czz5!1G!;z<<zz5!1z22    c                  ^ U4     SU4S jjjn[        U S5      (       a  [        U 5      $ [        U [        5      (       a  U[	        S5      :  a  [        XSUS9nU$ [        U 5      (       a  U[	        S5      :  a  [        U UUUUS9nU$ [        U [        5      (       a  U(       a  SU" U 5       S3nU$ U" U 5      nU$ )	a  
This function is the sanctioned way of converting objects
to a string representation and properly handles nested sequences.

Parameters
----------
thing : anything to be formatted
_nest_lvl : internal use only. pprint_thing() is mutually-recursive
    with pprint_sequence, this argument is used to keep track of the
    current nesting level, and limit it.
escape_chars : list or dict, optional
    Characters to escape. If a dict is passed the values are the
    replacements
default_escapes : bool, default False
    Whether the input escape characters replaces or adds to the defaults
max_seq_items : int or None, default None
    Pass through to other pretty printers to limit sequence printing

Returns
-------
str
c                  > SSSS.n[        U[        5      (       a5  T(       a  UR                  U5        OUn[        UR	                  5       5      nOU=(       d    Sn[        U 5      nU H  nUR                  XBU   5      nM     U$ )Nz\tz\nz\r)	r    )rF   dictupdater\   keysstrreplace)thingescape_chars	translateresultcdefault_escapess        r   as_escaped_string'pprint_thing.<locals>.as_escaped_string   s{     !U;	lD))  .(	 1 1 34L'-2LUA^^A|4F rc   __next__zdisplay.pprint_nest_depthT)quote_stringsr@   ro   rw   r@   ')rn   r   ro   EscapeChars | Nonereturnrl   )rH   rl   rF   ri   r   rb   r   rW   )rn   rQ   ro   rs   rw   r@   rt   rq   s      `    r   rL   rL      s    @ 8D"4	 $ uj!!5z	E4	 	 Y#2 & D
  M 
U			J7R,S S%''
 M 
E3		M&u-.a0 M #5)Mrc   c                :    [        U 5      nUR                  X5      $ N)rL   encode)objectencodingerrorsvalues       r   pprint_thing_encodedr      s      E<<))rc   c                  ^ S[         R                  ;  a  g SSKJn  U" 5       nUc  g UR                  R
                  nSnU (       a2  XC;  a#  SSKJn  SSKJ	m   " U4S jSU5      nU" 5       X4'   S	X4   l
        g XC;   a
  S
X4   l
        g g )NIPythonr   )get_ipythonz!application/vnd.dataresource+json)BaseFormatter
ObjectNamec                  .   > \ rS rSr Y " S5      r\4rSrg)<enable_data_resource_formatter.<locals>.TableSchemaFormatteri	  _repr_data_resource_rh   N)__name__
__module____qualname____firstlineno__print_methodri   _return_type__static_attributes__r   s   r   TableSchemaFormatterr   	  s    )*@A $wrc   r   TF)sysmodulesr   r   display_formatter
formattersIPython.core.formattersr   	traitletsr   enabled)enabler   ipr   mimetyper   r   r   s          @r   enable_data_resource_formatterr      s    ##	B	z%%00J2H%=,'} '
 $8#9J '+
$		',
$ 
 rc   c                    [        U SSUS9$ )N)rf   rg   r   Trx   rL   )rn   r@   s     r   default_pprintr     s    '#	 rc   c                  ^" [        5       u  pgUc  [        S5      =(       d    SnUc  [        U 5      R                  nU(       a"  [	        U5      nSSUS-   -   3n	SSUS-   -   3n
OSn	Sn
[	        U 5      nU(       a  S	S[	        U5      -  -   nOS
n[        S5      =(       d    UnX:  n[        5       m"            SU"4S jjnSU"4S jjnSnUS:X  a  SU 3nU$ US:X  a  U(       d  U" U S   5      nSU SU 3nU$ US:X  a*  U(       d#  U" U S   5      nU" U S   5      nSU SU SU 3nU$ US:X  a  / nU SS  Vs/ s H  nU" U5      PM     nnOeX:  aF  [        US-  S5      nU SU  Vs/ s H  nU" U5      PM     nnX* S  Vs/ s H  nU" U5      PM     nnO/ nU  Vs/ s H  nU" U5      PM     nnU(       a  U(       a  [        UU5      u  nnOU(       d<  [	        SR                  U5      5      U:  a  [	        SR                  U5      5      U:  dZ  [        U" U5      U" U5      5      nU Vs/ s H  nUR                  U5      PM     nnU Vs/ s H  nUR                  U5      PM     nnU(       a  U[	        U
5      -
  nUS   nSn[        [        S[	        U5      S-   5      5       H   n[        UUS9n[	        U5      U:  d  M  Un  O   U Vs/ s H  n[        UUS9PM     nnU Vs/ s H  n[        UUS9PM     nnSnU
nU H  nUU-   S-   n U" UUU Xj5      u  nnM     U(       a  UUR                  5       U
-   S-   -  nU
nUSS  H  n!U!U-   S-   n U" UUU Xj5      u  nnM     U" UUUS   US-
  U
5      u  nnUU-  nSUR                  S5      -   nUU-  n[	        U5      U:  d  U(       a  UU	-  nOUS-  nSU[	        U
5      S -   nU$ s  snf s  snf s  snf s  snf s  snf s  snf s  snf s  snf )a  
Return the formatted obj as a unicode string

Parameters
----------
obj : object
    must be iterable and support __getitem__
formatter : callable
    string formatter for an element
is_justify : bool
    should justify the display
name : name, optional
    defaults to the class name of the obj
indent_for_name : bool, default True
    Whether subsequent lines should be indented to
    align with the name.
line_break_each_value : bool, default False
    If True, inserts a line break for each value of ``obj``.
    If False, only break lines when the a line of values gets wider
    than the display width.

Returns
-------
summary string
Nzdisplay.widthP   r   r   rA      z
 z,
 rD   zdisplay.max_seq_itemsc                   > TR                  UR                  5       5      TR                  UR                  5       5      -   U:  a  XR                  5       -  n UnX-  nX4$ r}   )r"   rstrip)rU   liner   display_widthnext_line_prefixadjs        r   _extend_line+format_object_summary.<locals>._extend_line]  sQ     774;;=!CGGELLN$;;}LA#Dwrc   c                >   > U (       a  [        U4S jU  5       5      $ g)Nc              3  F   >#    U  H  nTR                  U5      v   M     g 7fr}   r"   )r   r-   r   s     r   r   :format_object_summary.<locals>.best_len.<locals>.<genexpr>h  s     26aswwqzz6s   !r   )r$   )valuesr   s    r   best_len'format_object_summary.<locals>.best_lenf  s    26222rc   rB   r   z[][]r   
   )r@   r   z...)rU   rl   r   rl   r   rl   r   intr   rl   r{   ztuple[str, str])r   	list[str]r{   r   )r   r   typer   r"   get_adjustmentrK   _justifyr   r$   r:   reversedrJ   rW   r   )#obj	formatter
is_justifynameindent_for_nameline_break_each_valuer   _name_lenspace1space2nsepr@   is_truncatedr   r   closesummaryfirstlastheadr-   tail
max_length	max_spacer   	max_items	num_itemspprinted_seqr   
head_valueword	tail_itemr   s#                                     @r   format_object_summaryr     s   B ()M"?39r|Cy!!t9shl+-.shl+-.CA sSY&67<1M $L 
C"%69MP	 EAvug,p No 
a-#a&!eWAeW%j Ni 
a-#a&!R!eWBtfAeW-b N_ AD*-bc(3(QIaL(D3DMQ&+A*-bq'2'QIaL'D2*-bc(3(QIaL(D3DD*-.#QIaL#D. $ &dD1
dDIIdO$}4		$(=8 !$$@
59:T
+T:59:T
+T: !
 &F3IGEI%eAs5zA~&>?	*5	J|$y0 )I	 @
 FJJTK;TDJEIJTK;TDJJ#c)D($mTMGT  t{{}v-55GDcrIs?S(D($mTMGT #
 %WdDHma>OQWX4 ell3''5w<=)-BvGsNG F..NY 4 33 / ;:" KJs0   >O.O	O $O%5O*O/O42O9c           
        X-   nS/[        US   5      -  nU HF  nU Vs/ s H  n[        U5      PM     nn[        X65       VVs/ s H  u  px[        Xx5      PM     nnnMH     U  V	s/ s H  n	[        S [        X5       5       5      PM      n
n	U V	s/ s H  n	[        S [        X5       5       5      PM      nn	X4$ s  snf s  snnf s  sn	f s  sn	f )a  
Justify items in head and tail, so they are right-aligned when stacked.

Parameters
----------
head : list-like of list-likes of strings
tail : list-like of list-likes of strings

Returns
-------
tuple of list of tuples of strings
    Same as head and tail, but items are right aligned when stacked
    vertically.

Examples
--------
>>> _justify([['a', 'b']], [['abc', 'abcd']])
([('  a', '   b')], [('abc', 'abcd')])
r   c              3  H   #    U  H  u  pUR                  U5      v   M     g 7fr}   r:   r   r-   r<   s      r   r   _justify.<locals>.<genexpr>        F1E:1aggg1E    "c              3  H   #    U  H  u  pUR                  U5      v   M     g 7fr}   r   r   s      r   r   r     r   r   )r"   r(   r$   rN   )r   r   combinedr   	inner_seqitemlengthr-   yrP   head_tuplestail_tupless               r   r   r     s    , {H s8A;''J	(12	#d)	2,/
,CD,CDAc!i,C
D
  SWRV3FS1EFFRV   SWRV3FS1EFFRV   ## 3Ds   B<C'%C%Cc                  "    \ rS rSrSrSS jrSrg)
PrettyDicti  z.Dict extension to support abbreviated __repr__c                    [        U 5      $ r}   r   selfs    r   __repr__PrettyDict.__repr__  s    D!!rc   rh   N)r{   rl   )r   r   r   r   __doc__r   r   rh   rc   r   r   r     s
    8"rc   r   c                  @    \ rS rSrSS jrS	S jrS
SS jjrSS jrSrg)_TextAdjustmenti  c                $    [        S5      U l        g )Nzdisplay.encoding)r   r   r   s    r   __init___TextAdjustment.__init__  s    "#56rc   c                    [        U5      $ r}   r   r   texts     r   r"   _TextAdjustment.len  s    4yrc   c                    US:X  a!  U Vs/ s H  oDR                  U5      PM     sn$ US:X  a!  U Vs/ s H  oDR                  U5      PM     sn$ U Vs/ s H  oDR                  U5      PM     sn$ s  snf s  snf s  snf r6   r8   )r   r;   r<   r   r-   s        r   justify_TextAdjustment.justify  sr     6>.34eGGG$e44X/45u!HHW%u55.34eGGG$e44	 554r=   c                N    [        U/UQ7U R                  U R                  S.UD6$ )N)r   r   )r4   r"   r   )r   r)   r*   r+   s       r   r4   _TextAdjustment.adjoin  s&    eVeVDHHt||VvVVrc   )r   Nr{   Noner   rl   r{   r   right)r;   r   r<   r   r   rl   r{   r   )r)   r   r{   rl   )	r   r   r   r   r   r"   r   r4   r   rh   rc   r   r   r     s    7	5Wrc   r   c                  T   ^  \ rS rSrSU 4S jjrSS jr S       S	S jjrSrU =r$ )
_EastAsianTextAdjustmenti  c                z   > [         TU ]  5         [        S5      (       a  SU l        OSU l        SSSSSS.U l        g )Nz!display.unicode.ambiguous_as_wider   rA   )NaNWFH)superr   r   ambiguous_width_EAW_MAP)r   	__class__s    r   r   !_EastAsianTextAdjustment.__init__  s>    9::#$D #$D 
  !qqqqArc   c                n   ^  [        U[        5      (       d  [        U5      $ [        U 4S jU 5       5      $ )z>
Calculate display width considering unicode East Asian Width
c              3     >#    U  H4  nTR                   R                  [        U5      TR                  5      v   M6     g 7fr}   )r  getr   r  )r   rr   r   s     r   r   /_EastAsianTextAdjustment.len.<locals>.<genexpr>$  s5      
RVQDMM.q143G3GHHRVs   <?)rF   rl   r"   sumr   s   ` r   r"   _EastAsianTextAdjustment.len  s6     $$$t9 
RV
 
 	
rc   c                4  ^ ^ UU 4S jnUS:X  a'  U Vs/ s H  oUR                  U" U5      5      PM     sn$ US:X  a'  U Vs/ s H  oUR                  U" U5      5      PM     sn$ U Vs/ s H  oUR                  U" U5      5      PM     sn$ s  snf s  snf s  snf )Nc                D   > TTR                  U 5      -
  [        U 5      -   $ r}   r   )tr<   r   s    r   _get_pad2_EastAsianTextAdjustment.justify.<locals>._get_pad,  s    TXXa[(3q611rc   r   r7   r8   )r   r;   r<   r   r  r-   s   ` `   r   r    _EastAsianTextAdjustment.justify(  s    	2 6>278%QGGHQK(%88X3895aHHXa[)599278%QGGHQK(%88	 998s    B B( B)r  r  r   r  r  r;   zIterable[str]r<   r   r   rl   r{   r   )	r   r   r   r   r   r"   r   r   __classcell__)r  s   @r   r  r    s>    
B	
 ?F9"9-098;9	9 9rc   r  c                 N    [        S5      n U (       a
  [        5       $ [        5       $ )Nz display.unicode.east_asian_width)r   r  r   )use_east_asian_widths    r   r   r   7  s#    %&HI'))  rc   )r)   r   r*   r   r{   rl   r  r  )r   N)rP   r   rQ   r   r@   
int | Noner{   rl   )rP   r   rQ   r   r@   r!  r{   rl   )r   NFFN)rn   r   rQ   r   ro   rz   rs   boolrw   r"  r@   r!  r{   rl   )zutf-8rm   )r   rl   r   rl   r{   bytes)r   r"  r{   r   r}   )rn   r   r@   r!  r{   rl   )TNTF)r   r   r   r"  r   z
str | Noner   r"  r   r"  r{   rl   )r   list[Sequence[str]]r   r$  r{   z3tuple[list[tuple[str, ...]], list[tuple[str, ...]]])r{   r   )(r   
__future__r   collections.abcr   r   r   r   typingr   r   r	   r
   unicodedatar   pandas._configr   pandas.core.dtypes.inferencer   pandas.io.formats.consoler   rl   EscapeCharsr   r   r4   r#   rW   rb   rL   r   r   r   r   r   ri   r   r   r  r   rh   rc   r   <module>r-     s   # 
   ) % 4 6GCH%x}45enen9@	1J DH !	 !! !6@ ! !H CG3	3 35?33B '+! $FFF %F 	F
 F F 	FT 4=**-0*
*-B  "'hh h 	h
 h  h 	hV&$
&$%8&$8&$R"c3h "W W,$9 $9N!rc   