+
    i                    z   R t ^ RIHtHt  ]! R4      t^ RIt^ RIH	t	 ^ RI
HtHt ^ RIHt ^ RIHtHt ^ R	IHtHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt ^ RItR
 t. EROt  ^RIHt ^t!Rt"Rt#Rt$Rt%Rt&Rt'Rt(]RJt)Rt*]	! R. ERO4      t+]	! R. ERO4      t,]	! R. RAO4      t-R t.R t/R t0R t1R t2R t3R t4R t5R t6R  t7ERR! lt8ERR" lt9R# t:R$R%R&R'R(R)R*R+R,R-R.R/R0R1R2R3R4R5R6R7R8R9R:R;/t;];3R< lt<R= t=/ R>]-! ]+! RR?R@R4      ]+! RR?R@R4      R]+! RR?R@R4      ],! RR@R4      ],! RR@R4      ^ RR.RA7      bRB]-! RRRR],! RR@R4      ],! RR@R4      ^ RRA7      bRC]-! ]+! RDR?RDRD4      ]+! RDRERDRD4      ]+! RDR?RDRD4      ]+! RDR?RDRD4      ],! RFRFRF4      ],! RFRFRF4      ^RRA7      bRG]-! ]+! RHRIRJRK4      ]+! RLRIRMRN4      ]+! RLRIRMRN4      ]+! RORIRPRQ4      ],! RRRRRR4      ],! RRRRRR4      ^RRA7      bRS]-! ]+! RTRIRJRU4      ]+! RLRIRMRN4      ]+! RLRIRMRN4      ]+! RVRIRPRW4      ],! RRRRRR4      ],! RRRRRR4      ^RRA7      bRX]-! ]+! RYRZR[R\4      ]+! R]RZR^R_4      ]+! R]RZR^R_4      ]+! R`RZRaRb4      ],! RcRcRc4      ],! RcRcRc4      ^RRA7      bRd]-! ]+! ReRZRfRg4      ]+! RhRZRiRj4      ]+! RLRIRMRN4      ]+! RkRZRlRm4      ],! RRRRRR4      ],! RRRRRR4      ^RRA7      bRn]-! ]+! RoRpRqRr4      ]+! RsRpRtRu4      ]+! RsRpRtRu4      ]+! RvRpRwRx4      ],! RyRyRy4      ],! RyRyRy4      ^RRA7      bRz]-! ]+! R{RpR|R}4      ]+! R~RpRR4      ]+! RLRIRMRN4      ]+! RRpRR4      ],! RRRRRR4      ],! RRRRRR4      ^RRA7      bR]-! ]+! RDR?RDRD4      ]3]+! RDR?RDRD4      ]+! RDR?RDRD4      ],! RFRFRF4      ],! RFRFRF4      ^RRA7      bR]-! ]+! RDR?RDRD4      ]+! RDRERDRD4      R]+! RDR?RDRD4      ],! RFRFRF4      ],! RFRFRF4      ^RRA7      bR]-! ]+! RHRIRJRK4      ]+! RLRIRMRN4      R]+! RORIRPRQ4      ],! RRRRRR4      ],! RRRRRR4      ^RRA7      bR]-! ]+! RTRIRJRU4      ]+! RLRIRMRN4      R]+! RVRIRPRW4      ],! RRRRRR4      ],! RRRRRR4      ^RRA7      bR]-! ]+! RYRZR[R\4      ]+! R]RZR^R_4      R]+! R`RZRaRb4      ],! RcRcRc4      ],! RcRcRc4      ^RRA7      bR]-! ]+! ReRZRfRg4      ]+! RhRZRiRj4      R]+! RkRZRlRm4      ],! RRRRRR4      ],! RRRRRR4      ^RRA7      bR]-! ]+! RoRpRqRr4      ]+! RsRpRtRu4      R]+! RvRpRwRx4      ],! RyRyRy4      ],! RyRyRy4      ^RRA7      bR]-! ]+! R{RpR|R}4      ]+! R~RpRR4      R]+! RRpRR4      ],! RRRRRR4      ],! RRRRRR4      ^RRA7      b/ R]-! ]+! RFR?RFRF4      ]+! RFR?RFRF4      RR],! RFRFRF4      ],! RFRFRF4      ^R.RA7      bR]-! ]1]1RR],! RFRFRF4      ],! RFRFRF4      ^R.RA7      bR]-! R]+! RFR?RDRF4      RR],! RFRFRF4      ],! RFRFRF4      ^RRA7      bR]-! RRRR],! RRR4      ],! RFRFRF4      ^RRA7      bR]-! R]+! RR?RDR4      RR],! RRFR4      ],! RRFR4      ^RRA7      bR]-! ]+! RDR?RDRD4      ]+! RDR?RDRD4      R]+! RDR?RDRD4      ],! RFRFRF4      ],! RFRFRF4      ^RRA7      bR]-! ]+! RDR?RDRD4      ]+! RFR?RDRF4      R]+! RDR?RDRD4      ],! RFRFRF4      ],! RFRFRF4      ^RRA7      bR]-! ]+! RRER@R4      ]+! RRER@R4      R]+! RRER@R4      ],! RR@R4      ],! RR@R4      ^ RRA7      bR]-! ]+! RRRR4      ]+! RRRR4      ]+! RRRR4      ]+! RRRR4      ]! ]4R4      ]! ]4RF4      ^ RRA7      bR]-! RRRR]! ]8RRR7      ]! ]8R4      ^RRA7      bR]-! RRRR],! RRR4      ],! RRR4      ^RRA7      bR]-! ]6RR]+! RRRR4      ]! ]7RR4      ]! ]7RR4      ^ R.RA7      bR]-! ]6RR]+! RRRR4      ]! ]7RR4      ]! ]7RR4      ^ R.RA7      bR]-! ]9]+! RRRR4      R]+! RRRR4      ]<]<^RRA7      bR]-! ]9]+! RRRR4      R]+! RRRR4      ]! ]</ R7      ]! ]</ R7      ^RRA7      bR]-! ]! ]9RR7      ]+! RRRR4      R]+! RRRR4      ]<]<^RRA7      bR]-! ]! ]9RR7      ]+! RRRR4      R]+! RRRR4      ]<]<^RRA7      bCR]-! RRRR],! RRR4      ],! RRR4      ^ RRA7      R]-! RRRR],! RRRF4      ]5^RRA7      R]-! ]! ]:R4      RR]+! RRRR4      ]! ]:R4      ]! ]:R4      ^R.RA7      /Ct>]?! ]>P                  4       4      tA/ RBRBbR>R>bRCRCbRGRGbRSRSbRXRXbRdRdbRnRnbRzRzbRRbRRbRRbRRbRRbRRbRRbRRbRRRRRRRRRRRRRRRR/CtB]P                  ! R4      tD]P                  ! R4      tERtF]F R2tG]F R2tH]F R2tIR]G R]H R]F R]I R]F R]H R]I R2tJ]P                  ! ]J]P                  4      tL]P                  ! ]JP                  R4      ]P                  4      tNRtO]P                  ! R4      tPR tQR tRR tSR tT]U3R ltVR tWERR ltXR tYR tZR t[R t\R t]R t^R t_R t`]a3R ltbR tcR tdR te]a3R ltfR tgERR lthR tiERR ltjER	R ltkER
R ltlR tmR tnR toR tpERR ltqR]']#]$3R ltrERR ltsERR>]%]&](](]'RRRRRRRRRR]#]$3R lttR tuR tvR twR txR tyERR ltzR t{ERR lt|R t}R t~ ! R R]4      tR t ! R R]EP                  4      tR tER  t]ER8X  d
   ]! 4        R# R#   ] d    Rt E
Li ; i  ] d    Rt E
LRi ; i  ] d     E
LQi ; i(  zPretty-print tabular data.)versionPackageNotFoundErrortabulateunknownN)
namedtuple)IterableSized)escape)chainzip_longest)reducepartialc                 6    \        V \        P                  4      # N)
isinstanceioIOBase)fs   &Z/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/tabulate/__init__.py_is_filer       s    a##    )r   FTg defaultLineDataRowTableFormat	lineabove	linebelowc                 b    \        V 4      \        J ;'       d    V P                  4       \        8H  # r   )typestrstripSEPARATING_LINE)values   &r   _is_separating_line_valuer&   z   s$    ;#BB%++-?"BBr   c                    \        V 4      pV\        8H  ;'       g    V\        8H  ;'       dY    \        V 4      ^8  ;'       d    \	        V ^ ,          4      ;'       g)    \        V 4      ^8  ;'       d    \	        V ^,          4      pV# )   )r!   listr"   lenr&   )rowrow_typeis_sls   &  r   _is_separating_liner.   ~   s{    CyH00S  	SQ	<	<4SV< 	A 	AHM??7A? 

 Lr   c                    TpV R9   d   RV^,
          ,          R,           # V R8X  d   RRV^,
          ,          ,           R,           # V R8X  d   RRV^,
          ,          ,           # RV,          # )zzReturn a segment of a horizontal line with optional colons which
indicate column's alignment (as in `pipe` output format).-:centerleft)rightdecimal )aligncolwidthws   && r   _pipe_segment_with_colonsr:      sh     	A$$q1u$$	(	cQUm$s**	&cQUm$$Qwr   c                    V'       g   R.\        V 4      ,          pRP                  R \        W4       4       4      pRV R2# )zjReturn a horizontal line with optional colons to indicate column's
alignment (as in `pipe` output format).r   |c              3   <   "   T F  w  r\        W4      x  K  	  R # 5ir   )r:   .0ar9   s   &  r   	<genexpr>)_pipe_line_with_colons.<locals>.<genexpr>         4MDA!!''4M   r*   joinzip	colwidths	colalignssegmentss   && r   _pipe_line_with_colonsrL      G     D3y>)	xx 47	4M H xj?r   c                    T pVR8X  d   RV^,
          ,          R,           # VR8X  d   RRV^,
          ,          ,           R,           # VR8X  d   RRV^,
          ,          ,           # RV,          # )zmReturn a segment of a horizontal line with optional colons which indicate
column's alignment in a grid table.r4   =r1   r2   r3   r6   )r8   r7   widths   && r   _grid_segment_with_colonsrQ      sk     Euqy!S((	(	cUQY'(3..	&cUQY'((U{r   c                    V'       g   R.\        V 4      ,          pRP                  R \        W4       4       4      pRV R2# )z]Return a horizontal line with optional colons to indicate column's alignment
in a grid table.r   +c              3   <   "   T F  w  r\        W!4      x  K  	  R # 5ir   )rQ   r>   s   &  r   rA   )_grid_line_with_colons.<locals>.<genexpr>   rC   rD   rE   rH   s   && r   _grid_line_with_colonsrV      rM   r   c           	         R RRRRRRR/p\        W4       UUu. uF,  w  rVRVP                  VR4      ,           V,           R,           NK.  	  pppV ^,          pWP                  V4      ,           P                  4       # u uppi )r3   r   r4   zstyle="text-align: right;"| r2   zstyle="text-align: center;"| r5    )rG   getrF   rstrip)		separatorcell_valuesrI   rJ   	alignmentcr@   values_with_attrscolseps	   &&&&     r   _mediawiki_row_with_attrsra      s    /11	I :=[9T9TimmAr""Q&,,9T   ]F$566>>@@	s   2A<c                    a V ^ ;;,          R,          uu&   RRRRRRRR/oR	P                  V3R
 l\        W 4       4       4      pR	V R	2# )    rX   r3   z<.r4   z>.r2   z=.r5   r<   c              3   Z   <"   T F   w  rSP                  VR 4      V,           x  K"  	  R# 5i)r   NrY   )r?   r@   vr]   s   &  r   rA   *_textile_row_with_attrs.<locals>.<genexpr>   s(     W;V41immAr*Q..;Vs   (+)rF   rG   )r\   rI   rJ   valuesr]   s   &&& @r   _textile_row_with_attrsri      sN    NcNwhiNIXXW3y;VWWFvha=r   c                     R # )z<table>
<tbody>r6   )colwidths_ignorecolaligns_ignores   &&r    _html_begin_table_without_headerrm      s    r   c                    R RRRRRRR/pV'       d@   \        W$4       UUu. uF'  w  rgRP                  WP                  VR4      V4      NK)  	  pppMG\        W$4       UUu. uF0  w  rgRP                  WP                  VR4      \        V4      4      NK2  	  pppRP                  RP	                  V4      P                  4       4      p	V R	8X  d   R
V	 R2p	V	# u uppi u uppi )r3   r   r4   z style="text-align: right;"r2   z style="text-align: center;"r5   z<{0}{1}>{2}</{0}>z<tr>{}</tr>thz<table>
<thead>
z
</thead>
<tbody>)rG   formatrY   
htmlescaperF   rZ   )
celltagunsafer\   rI   rJ   r]   r^   r@   r_   rowhtmls
   &&&&&     r   _html_row_with_attrsru      s    .00	I  K3
3  &&wa0DaH3 	 
 K3
3  &&wa0DjQRmT3 	 
 ""277+<#=#D#D#FGG$&wi/BCN


s   -C 6Cc                     R RRRRRRR/p\        W4       UUu. uF4  w  rgRP                  WP                  VR4      WF,           V,           4      NK6  	  pppRP                  V4      R,           # u uppi )	r3   r   r4   z<style="text-align: right;">r2   z<style="text-align: center;">r5   z{}{} {} ||)rG   rp   rY   rF   )	rr   r\   rI   rJ   headerr]   r^   r@   r_   s	   &&&&&    r   _moin_row_with_attrsry      s    /11	I //DA 	'==B#7f9LM/   77$%,,	s   :A.c           	          R RRRRRRR/pRP                  V Uu. uF  qTP                  VR4      NK  	  up4      pRP                  V'       g   R	MR
V,           R,           V'       d   R.4      # R.4      # u upi )r3   lr4   rr2   r^   r5   r   
z\begin{tabular}{z\begin{longtable}{}z\toprule\hline)rF   rY   )rI   rJ   booktabs	longtabler]   r@   tabular_columns_fmts   &&&&   r   _latex_line_begin_tabularr      s    gsHc9cJI'')"L)Q==C#8)"LM99(1 7L!" $K		
 
 *3		
  #Ms   A5c                    R p\        V4      ^8X  d   V! R.VO5!  # \        V4      ^8X  d?   Vw  r4pRRP                  V4      ,           pV '       d   V! RWE4      R,           V,           # V# \        R4      h)z/handle header and data rows for asciidoc formatc                    R RRRRRRR/p\        Y Uu. uF  qCV,          NK  	  up4      pV UUu. uF  w  rgV VR 2NK  	  pppRR	P                  V4      ,           R
,           .p	. p
V '       d   V
P                  R4       V
'       d'   R	P                  V
4      p
V	P                  RV
 R
24       RP                  R	P                  V	4      4      # u upi u uppi )r3   <r4   >r2   ^r5   dzcols=","rx   z	options="z
[{}]
|====)rG   rF   appendrp   )	is_headerrI   rJ   r]   colalignasciidoc_alignmentsrP   r7   asciidoc_column_specifiersheader_listoptions_lists   &&&        r   make_header_line'_asciidoc_row.<locals>.make_header_line  s     S'3#y#N	!IFI(++IF
 5H&
4GLEugeAY4G 	# &
  388,F#GH3NO )88L1L<.:; ##CHH[$9::' G&
s
   C
CFr<   Tr}   zl_asciidoc_row() requires two (colwidths, colaligns) or three (cell_values, colwidths, colaligns) arguments) )r*   rF   
ValueError)r   argsr   r\   rI   rJ   	data_lines   &*     r   _asciidoc_rowr     s    ;6 4yA~  ---	Ta -1)	#((;//	#D)?$FRR I
 	
r   &z\&%z\%$z\$#z\#_z\_r   z\^{}{z\{r~   z\}~z\textasciitilde{}\z\textbackslash{}r   z\ensuremath{<}r   z\ensuremath{>}c           	         a V3R  lpV  Uu. uF  pRP                  \        WE4      4      NK  	  pp\        RRR4      p\        Wg4      # u upi )c                 &   < SP                  W 4      # r   re   )r^   escruless   &r   escape_char_latex_row.<locals>.escape_charO  s    ||A!!r   r   r   \\)rF   mapr   _build_simple_row)r\   rI   rJ   r   r   cellescaped_valuesrowfmts   &&&f    r   
_latex_rowr   N  sM    " CNN+$bggc+45+NNRf%F^44 Os   #A	c                     R  p\        V4      p. pV'       d   V! V^ ,          4      V^ &   V  F9  p\        V4      pV'       d   V! V^ ,          4      V^ &   VP                  V4       K;  	  WC3# )c                 n    \        V \        \        34      '       d   V P                  4       '       g   R # V # )z..)r   r"   bytesr#   vals   &r   escape_empty._rst_escape_first_column.<locals>.escape_emptyX  s%    cC<((Jr   )r)   r   )rowsheadersr   new_headersnew_rowsr+   new_rows   &&     r   _rst_escape_first_columnr   W  sk     w-KH%gaj1As)%c!f-GAJ 	 
   r   simpler0   z  )r   linebelowheaderlinebetweenrowsr   	headerrowdatarowpaddingwith_header_hideplaingridrS   rO   r<   simple_gridu   ┌u   ─u   ┬u   ┐u   ├u   ┼u   ┤u   └u   ┴u   ┘u   │rounded_gridu   ╭u   ╮u   ╰u   ╯
heavy_gridu   ┏u   ━u   ┳u   ┓u   ┣u   ╋u   ┫u   ┗u   ┻u   ┛u   ┃
mixed_gridu   ┍u   ┯u   ┑u   ┝u   ┿u   ┥u   ┕u   ┷u   ┙double_gridu   ╔u   ═u   ╦u   ╗u   ╠u   ╬u   ╣u   ╚u   ╩u   ╝u   ║
fancy_gridu   ╒u   ╤u   ╕u   ╞u   ╪u   ╡u   ╘u   ╧u   ╛
colon_gridoutlinesimple_outlinerounded_outlineheavy_outlinemixed_outlinedouble_outlinefancy_outlinegithubpipeorgtbljirarw   prestoprettypsqlrst	mediawikiz.{| class="wikitable" style="text-align: left;"z
|+ <!-- caption -->
|-z|-z|}!moinmoinz''')rx   youtrackz|| z || z| z | z |htmlz</tbody>
</table>ro   td
unsafehtmllatexr   z\hline
\end{tabular}	latex_raw)r   latex_booktabs)r   z\midrulez\bottomrule
\end{tabular}latex_longtable)r   z\hline
\endheadz\hline
\end{longtable}tsv	textilez|_. z|_.asciidocz|====z
\r|\n|\r\ns   |
|
z\x1bz\[z\]r   z.
    (
        # terminal colors, etc
        z        # CSI
        [\x30-\x3f]*  # parameter bytes
        [\x20-\x2f]*  # intermediate bytes
        [\x40-\x7e]   # final byte
    |
        # terminal hyperlinks
        z8;        # OSC opening
        (\w+=\w+:?)*    # key=value params list (submatch 2)
        ;               # delimiter
        ([^z5]+)    # URI - anything but ESC (submatch 3)
        z           # ST
        ([^z;]+)    # link text - anything but ESC (submatch 4)
        z8;;z!  # "closing" OSC sequence
    )
utf8z[0mz>^(([+-]?[0-9]{1,3})(?:,([0-9]{3}))*)?(?(1)\.[0-9]*|\.[0-9]+)?$c                T    \        RRRR\        RV R4      \        RV R4      ^ RR7      # )zConstruct a simple TableFormat with columns separated by a separator.

>>> tsv = simple_separated_format("\t") ;         tabulate([["foo", 1], ["spam", 23]], tablefmt=tsv) == 'foo \t 1\nspam\t23'
True

Nr   )r   r   r   r   )r   r   )r[   s   &r   simple_separated_formatr   J  s;     "i,Ir*	 	r   c                     V P                  4       p \        \        P
                  ! \        V 4      4      #   \        \        3 d     L7i ; i)aT  
>>> _isnumber_with_thousands_separator(".")
False
>>> _isnumber_with_thousands_separator("1")
True
>>> _isnumber_with_thousands_separator("1.")
True
>>> _isnumber_with_thousands_separator(".1")
True
>>> _isnumber_with_thousands_separator("1000")
False
>>> _isnumber_with_thousands_separator("1,000")
True
>>> _isnumber_with_thousands_separator("1,0000")
False
>>> _isnumber_with_thousands_separator("1,000.1234")
True
>>> _isnumber_with_thousands_separator(b"1,000.1234")
True
>>> _isnumber_with_thousands_separator("+1,000.1234")
True
>>> _isnumber_with_thousands_separator("-1,000.1234")
True
)decodeUnicodeDecodeErrorAttributeErrorboolrematch _float_with_thousands_separatorsstrings   &r   "_isnumber_with_thousands_separatorr   ^  sD    2 96BCC / s   6 A
	A
c                 H     V ! V4       R #   \         \        3 d     R# i ; i)TF)r   	TypeError)convr   s   &&r   _isconvertibler     s(    V	" s    !!c                   \        V 4      \        \        39   ;'       g    \        \        V 4      ;'       d    \	        V \
        \        34      '       * ;'       gg    \        P                  ! \        V 4      4      ;'       g     \        P                  ! \        V 4      4      '       * ;'       g    V P                  4       R9   # )a  Detects if something *could* be considered a numeric value, vs. just a string.

This promotes types convertible to both int and float to be considered
a float.  Note that, iff *all* values appear to be some form of numeric
value such as eg. "1e2", they would be considered numbers!

The exception is things that appear to be numbers but overflow to
+/-inf, eg. "1e23456"; we'll have to exclude them explicitly.

>>> _isnumber(123)
True
>>> _isnumber(123.45)
True
>>> _isnumber("123.45")
True
>>> _isnumber("123")
True
>>> _isnumber("spam")
False
>>> _isnumber("123e45")
True
>>> _isnumber("123e45678")  # evaluates equal to 'inf', but ... isn't
False
>>> _isnumber("inf")
True
>>> from fractions import Fraction
>>> _isnumber(Fraction(1,3))
True

)infz-infnan)r!   floatintr   r   r"   r   mathisinfisnanlowerr   s   &r   	_isnumberr    s    B 	V$ 	
 	
 5&) 
 
 vU|44   E&M2OOdjjv6OP @ @||~)??r   c                $   \        V 4      VJ ;'       g}    \        V R4      ;'       g    \        V R4      ;'       d,    \        \        V 4      4      P                  R4      ;'       g*    \	        V \
        \        34      ;'       d    \        W4      # )z3
>>> _isint("123")
True
>>> _isint("123.45")
False

is_integer	__array__z<class 'numpy.int)r!   hasattrr"   
startswithr   r   r   )r   inttypes   &&r   _isintr
    s     	V 	
 	
V\*JJgfk.J B BDL!,,-@A	
 	
 vs|,PP1P	r   c                z    \        V 4      \        J ;'       g$    \        V \        \        34      ;'       d    V R9   # )zG
>>> _isbool(True)
True
>>> _isbool("False")
True
>>> _isbool(1)
False
)TrueFalse)r!   r   r   r   r"   r   s   &r   _isboolr    s;     <4  6E3<(HHV7H-Hr   c                   V'       d(   \        V \        \        34      '       d   \        V 4      p V e%   \        V \        \        34      '       d   V '       g   \	        R4      # \        V R4      '       d   \        # \        V 4      '       d   \        # V'       dF   \        V 4      '       g/   \        V \        4      '       d   \        V 4      '       d   RV 9  d   \        # V'       d?   \        V 4      '       g(   \        V \        4      '       d   \        V 4      '       d   \        # \        V \        4      '       d   \        # \        # )a  The least generic type (type(None), int, float, str, unicode).

Treats empty string as missing for the purposes of type deduction, so as to not influence
the type of an otherwise complete column; does *not* result in missingval replacement!

>>> _type(None) is type(None)
True
>>> _type("") is type(None)
True
>>> _type("foo") is type("")
True
>>> _type("1") is type(1)
True
>>> _type('[31m42[0m') is type(42)
True
>>> _type('[31m42[0m') is type(42)
True

N	isoformat.)r   r"   r   _strip_ansir!   r  r  r   r
  r   r   r  r   )r   has_invisiblenumparses   &&&r   _typer    s    * FS%L99V$~*VeS\::6Dz		%	%
		vvs##26::6! 
	&vs##(J6(R(R	FE	"	"
r   c                &   \        V 4      '       g   \        V 4      '       do   \        V 4      '       d   R# V P                  R4      pV^ 8  d    V P	                  4       P                  R4      MTpV^ 8  d   \        V 4      V,
          ^,
          # R# R# )zSymbols after a decimal point, -1 if the string lacks the decimal point.

>>> _afterpoint("123.45")
2
>>> _afterpoint("1001")
-1
>>> _afterpoint("eggs")
-1
>>> _afterpoint("123e45")
2
>>> _afterpoint("123,456.78")
2

r  e)r  r   r
  rfindr  r*   )r   poss   & r   _afterpointr    sy     >vFF&>>I,,s#C/2Qw&,,.&&s+CCax6{S(1,,		r   c                6    RV ,          pVP                  V4      # )u@   Flush right.

>>> _padleft(6, 'яйца') == '  яйца'
True

z{0:>%ds}rp   rP   sfmts   && r   _padleftr!  +       u
C::a=r   c                6    RV ,          pVP                  V4      # )u@   Flush left.

>>> _padright(6, 'яйца') == 'яйца  '
True

z{0:<%ds}r  r  s   && r   	_padrightr$  6  r"  r   c                6    RV ,          pVP                  V4      # )uB   Center string.

>>> _padboth(6, 'яйца') == ' яйца '
True

z{0:^%ds}r  r  s   && r   _padbothr&  A  r"  r   c                     V# r   r6   )ignore_widthr  s   &&r   _padnoner)  L  s    Hr   c                    \        V \        4      '       d   \        P                  RV 4      # \        P                  RV 4      # )a  Remove ANSI escape sequences, both CSI (color codes, etc) and OSC hyperlinks.

CSI sequences are simply removed from the output, while OSC hyperlinks are replaced
with the link text. Note: it may be desirable to show the URI instead but this is not
supported.

>>> repr(_strip_ansi('\x1B]8;;https://example.com\x1B\\This is a link\x1B]8;;\x1B\\'))
"'This is a link'"

>>> repr(_strip_ansi('\x1b[31mred\x1b[0m text'))
"'red text'"

z\4)r   r"   _ansi_codessub_ansi_codes_bytesr  s   &r   r  r  P  s5     !Sua(( $$UA..r   c                    \         e   \        '       d   \         P                  pM\        p\	        V \
        \        34      '       d   V! \        V 4      4      # V! \        V 4      4      # )zVisible width of a printed string. ANSI color codes are removed.

>>> _visible_width('[31mhello[0m'), _visible_width("world")
(5, 5)

)wcwidthWIDE_CHARS_MODEwcswidthr*   r   r"   r   r  )r  len_fns   & r   _visible_widthr4  d  sL     !!!c5\""k!n%%c!f~r   c                     \        V \        4      '       d%   \        \        P                  ! \
        V 4      4      # \        \        P                  ! \        V 4      4      # r   )r   r"   r   r   search_multiline_codes_multiline_codes_bytesr.  s   &r   _is_multiliner9  v  s=    !SBII.233BII4a899r   c           	     V    \        \        V\        P                  ! RV 4      4      4      # z1Visible width of a potentially multiline content.[
])maxr   r   splitmultiline_sline_width_fns   &&r   _multiline_widthrB  }  s    s="((8["ABCCr   c                   a V '       d   \         oMV'       d   \        P                  oM\        oV'       d	   V3R lpV# SpV# )z2Return a function to calculate visible cell width.c                    < \        V S4      # r   )rB  r  rA  s   &r   <lambda>"_choose_width_fn.<locals>.<lambda>  s    -a?r   r4  r0  r2  r*   r  enable_widecharsis_multilinewidth_fnrA  s   &&& @r   _choose_width_fnrM    s9    &	((? O !Or   c                    VR 8X  d0   V'       g   V  Uu. uF  qDP                  4       NK  	  p p\        pW3# VR8X  d0   V'       g   V  Uu. uF  qDP                  4       NK  	  p p\        pW3# VR8X  d   V'       d%   V  Uu. uF  p\        \	        V4      4      NK  	  ppMV  Uu. uF  p\        V4      NK  	  pp\        V4      p\        W4       UUu. uF  w  rHWGV,
          R,          ,           NK  	  p pp\        pW3# V'       g
   \        pW3# V'       g   V  Uu. uF  qDP                  4       NK  	  p p\        pW3# u upi u upi u upi u upi u uppi u upi )r4   r2   r5   rX   )	r#   r!  r&  r  r  r=  rG   r)  r$  )	stringsr]   r  preserve_whitespacer  padfndecimalsmaxdecimalsdecss	   &&&&     r   _align_column_choose_padfnrU    sJ   G"*12'Qwwy'G2& >% 
h	"*12'Qwwy'G2 > 
i	=DEWKN3WHEH0781AH8(mADWAWXAWga1d*c111AWX > 
 > #*12'Qwwy'G2>) 3 3 F8X 3s#   E 
E E
$E!EEc                    a V '       d   \         oMV'       d   \        P                  oM\        oV'       d	   V3R  lpV# SpV# )c                    < \        V S4      # r   )_align_column_multiline_widthrE  s   &r   rF  /_align_column_choose_width_fn.<locals>.<lambda>  s    :}
r   rH  rI  s   &&& @r   _align_column_choose_width_fnrZ    s;    &	((

 O !Or   c           	     V    \        \        V\        P                  ! RV 4      4      4      # r;  )r)   r   r   r>  r?  s   &&r   rX  rX    s    M288Hk#BCDDr   c                     . pV  F=  p\        V\        4      '       d   VP                  V4       K,  VP                  V4       K?  	  V# r   )r   r)   extendr   )nested_listretitems   &  r   
_flat_listra    s=    
CdD!!JJtJJt	 
 Jr   c                   \        WW64      w  r\        W4V4      p\        \        W4      4      p	\	        \	        \        V	4      4      V4      p
V'       Ed\   V'       gP   V'       gH   V  UUu. uF7  pRP                  VP                  4        Uu. uF
  q! W4      NK  	  up4      NK9  	  pppV# V  UUu. uF3  p\        P                  ! RV4       Uu. uF  p\        V4      NK  	  upNK5  	  ppp\        W4       UUUUu. uF5  w  pp\        VV4       UUu. uF  w  ppV
VV,
          ,
          NK  	  uppNK7  	  ppppp\        V V4       UUUUu. uFT  w  rRP                  \        VP                  4       ;'       g    TV4       UUu. uF  w  ppV! VV4      NK  	  upp4      NKV  	  ppppp V# V'       g!   V'       g   V  Uu. uF
  q! W4      NK  	  ppV# \        \        \        V 4      4      p\        W4       UUu. uF  w  ppV
VV,
          ,
          NK  	  ppp\        V V4       UUu. uF  w  ppV! VV4      NK  	  pppV# u upi u uppi u upi u uppi u uppi u uppppi u uppi u uppppi u upi u uppi u uppi )z[string] -> [padded_string]r}   r<  )rU  rZ  r)   r   r=  ra  rF   
splitlinesr   r>  r*   rG   )rO  r]   minwidthr  rJ  rK  rP  rQ  rL  s_widthsmaxwidthmsr  padded_stringss_lensmwmlr9   r{   visible_widthss   &&&&&&&             r   _align_columnrm    sh    0MNG -H C*+H3z(+,h7H| "!B 		r}}G!5-GH!  6 + JQQ2rxx"'=>'=!s1v'=>FQ "(33FB 14B<1QU##<3   "'>::FB 		38M8M2PR3ST3S41a5A;3STU:  N   :AB'QeH0'NB  #c7+,F=@=RS=RTQh!a%00=RNS 7:'>6RS6RdaeAqk6RNS5 H ?Q< U C T Tsx   +"III2II$I>I$
I1I$
-I2
=I2
I,I2
I: I?.JIII$
,I2
c                    \        R 4      ^ \        ^\        ^\        ^\        ^\
        ^/p^\
        ^\        ^\        ^\        ^\        ^ \        R 4      /p\        VP                  V ^4      VP                  V^4      4      pW4,          # r   )r!   r   r   r   r   r"   r=  rY   )type1type2typesinvtypesmoregenerics   &&   r   _more_genericrt    s    T
AaQqqQE 	
3	5	5	3	4	4:H eiiq)599UA+>?K  r   c                l    V  Uu. uF  p\        W1V4      NK  	  pp\        \        V\        4      # u upi )u  The least generic type all column values are convertible to.

>>> _column_type([True, False]) is bool
True
>>> _column_type(["1", "2"]) is int
True
>>> _column_type(["1", "2.3"]) is float
True
>>> _column_type(["1", "2.3", "four"]) is str
True
>>> _column_type(["four", 'пять']) is str
True
>>> _column_type([None, "brux"]) is str
True
>>> _column_type([1, 2, None]) is int
True
>>> import datetime as dt
>>> _column_type([dt.datetime(1991,2,19), dt.time(17,35)]) is str
True

)r  r   rt  r   )rO  r  r  r  rq  s   &&&  r   _column_typerv    s5    , 9@@1U1X.E@--- As   1c                   V f   V# \        V \        \        34      '       d   V '       g   R# V\        J d   V  # V\        J Ed   \        V \        4      '       d   V P	                  R4      P                  R4      p\        P                  ! RV4      pV'       d   \        VP                  4       4      pV^8X  d   VP                  ^4      p	V	P                  4       '       db   VP                  ^4      \        \        V	4      V4      ,           VP                  ^4      ,           p
V
P	                  R4      P                  R4      p Rp\        W4      # V\        J d    \        V R4      # V\        J d   T;'       d    \        V \        \        34      pV'       d3   \!        V 4      p \        \        V4      V4      pT P%                  Y4      # \        V \        4      '       d   RV 9   d   V P%                  RR4      p  \        \        V 4      V4      # V  #   \        \        3 d    \        T 4      u # i ; i  \"        \        3 d    T  u # i ; i  \"        \        3 d    T  u # i ; i)u  Format a value according to its deduced type.  Empty values are deemed valid for any type.

Unicode is supported:

>>> hrow = ['буква', 'цифра'] ;         tbl = [['аз', 2], ['буки', 4]] ;         good_result = '\u0431\u0443\u043a\u0432\u0430      \u0446\u0438\u0444\u0440\u0430\n-------  -------\n\u0430\u0437             2\n\u0431\u0443\u043a\u0438           4' ;         tabulate(tbl, headers=hrow) == good_result
True

r   unicode_escapezutf-8z/(\\[xX]+[0-9a-fA-F]+\[\d+[mM]+)([0-9.]+)(\\.*)$asciir   )r   r   r"   r   encoder   r   r6  r*   groupsgroupisdigitrp   r   r   r   r  r   replace)r   valtypefloatfmtintfmt
missingvalr  val_stripedcoloredtotal_groupsdigitsval_newis_a_colored_numberraw_valformatted_vals   &&&&&&        r   _formatr  -  s    {#s|$$S#~	Cc3**%56==gFKiiBKG "7>>#341$$]]1-F~~''#MM!,$S[&9:%mmA./  
 &nnW5<<=MNFc""	E		sG$$ 
E	+MM
3e0M!#&G  &uW~x @ ;;w66#s##s
kk#r* eCj(33 ' -. 	s8O	 	*    	*   s6   H $H4 :I H10H14I
II%$I%c                ^   V'       dN   \         P                  ! \        V 4      pV Uu. uF  p\        WqW%! V4      4      NK  	  ppRP	                  V4      # \        V 4      V,
          p	W),          pVR8X  d   \        W 4      # VR8X  d   \        W 4      # V'       g   V  # \        W 4      # u upi )zIPad string header to width chars given known visible_width of the header.r}   r3   r2   )	r   r>  r7  _align_headerrF   r*   r$  r&  r!  )
rx   r]   rP   visible_widthrK  rL  header_lineshpadded_lines
ninvisibles
   &&&&&&    r   r  r  l  s     xx 0&9EQ
EQM!x{;\ 	 
 yy&&V},J	EF''	h	&&&&
s   B*c                     \        V \        4      '       dQ   . p. p\        V 4       F:  w  r4\        V4      '       d   VP	                  V4       K)  VP	                  V4       K<  	  W!3# V R 3# r   )r   r)   	enumerater.   r   )r   separating_lines	sans_rowsindexr+   s   &    r   _remove_separating_linesr    sf    $	#D/JE"3'' ''.  %	 *
 **Tzr   c                 X    V'       d"   V F  pV P                  V\        4       K  	  R # R # r   )insertr$   )r   r  r  s   && r   _reinsert_separating_linesr    s"    %EKK/ & r   c           	        Ve   VRJ d   V # \        V\        4      '       dD   \        V4      \        V 4      8w  d+   \        RR\        V4       R\        V 4       2,           4      h\	        V 4      w  r#. p\        V4      pV F0  p\        V4      pVP                  V.\        V4      ,           4       K2  	  Tp \        W4       V # )zAdd a left-most index column.Fz2index must be as long as the number of data rows: zlen(index)=z len(rows)=)
r   r   r*   r   r  iternextr   r)   r  )r   r  r  r  r   
index_iterr+   index_vs   &&      r   _prepend_row_indexr    s    }%CJ#d)$;@CJ<{3t9+>?
 	
 #;4"@IHeJz"	DI-.  Dt6Kr   c                >     \        V 4      #   \         d     R# i ; i)zDA wrapper around standard bool() which doesn't throw on NumPy arraysF)r   r   r   s   &r   _boolr    s#    Cy s   
 c                l    \        V4       RpRp\        V R4      '       Edd   \        V R4      '       EdQ   \	        V P
                  4      '       d3   V P                  4       p \        \        V P                  4       !  4      pM\        V R4      '       d   \        V 4      pVR9   dw   V P                  P                  e_   \        V P                  P                  \        4      '       d   V P                  P                  VR&   MV P                  P                  .VR&   V P
                  p\        V P                  4      pV Uu. uF  p\        V4      NK  	  ppM\        R	4      hVR8X  d   \        \        \        V4      4      pEM/ \        V 4      pTR8X  d   T'       g   . pEMTR8X  dG   \        T R
4      '       d5   T P                  P                  '       d   T P                  P                  pEMTR8X  ds   \!        T4      ^ 8  dc   \        T^ ,          \"        4      '       dF   \        T^ ,          R4      '       d-   \        \        \        T^ ,          P$                  4      4      pEMJ\!        T4      ^ 8  Ed   \        T^ ,          R4      '       Ed   \        T^ ,          R4      '       Ed   \'        4       p	. pTR8X  dU   \!        T4      ^ 8  d
   T^ ,          M/ p
TP)                  T
P                  4       4       T	P+                  T4       TR,          pT FD  pTP                  4        F-  pY9  g   K  TP-                  T4       T	P/                  T4       K/  	  KF  	  TR8X  d   TpM\        T\0        4      '       d:   T Uu. uF  qP3                  Y4      NK  	  pp\        \        \        T4      4      pMgTR8X  dN   \!        T4      ^ 8  d;   T Uu. uF  pX
P3                  Y4      NK  	  pp\        \        \        T4      4      pM. pMT'       d   \        R4      hT UUu. uF"  q Uu. uF  qP3                  T4      NK  	  upNK$  	  pppEMbTR8X  dZ   \        T R4      '       dH   \        T R4      '       d6   \        T R4      '       d$   T P4                   Uu. uF  q^ ,          NK  	  ppEM\6        e   \!        T4      ^ 8  d   \6        P8                  ! T^ ,          4      '       d   \6        P:                  ! T^ ,          4       Uu. uF  qP                  NK  	  ppTR8X  d   TpT UUu. uF1  p\=        T4      '       g   T Uu. uF  p\?        Y4      NK  	  upMTNK3  	  pppMITR8X  dC   \!        T4      ^ 8  d3   \        \        \        \A        \!        T^ ,          4      4      4      4      pVR8X  dl   \!        V4      ^ 8  d\   Ve,   V^ ,          .\        V^ ,          4      ,           pVR,          pM	V^ ,          p\        \        \        V4      4      pVR,          pM	VR8X  d   . p\        \        \        V4      4      p\        \        R V4      4      p\C        V4      \        \D        39   pVR8X  d   Ve   \G        Wd4      pM\        V\H        4      '       d   V'       g   \G        V\        V4      4      pM\        V\J        4      '       d   V'       g   \G        Wb4      pMnVR8X  g   \M        V4      '       d6   V'       g.   Vf   \        \A        \!        V4      4      4      p\G        Wd4      pM!VR8X  g   \M        V4      '       g
   V'       g    ^ pV'       dN   \!        V4      ^ 8  d>   \O        ^ \!        V^ ,          4      \!        V4      ,
          4      pR.V,          V,           pWaV3#   \         d    \        T4      p ELi ; i  \         d    \        T4      hi ; iu upi   \         d    \        T4      hi ; iu upi u upi u upi u uppi u upi u upi u upi u uppi )a  Transform a supported data type to a list of lists, and a list of headers,
with headers padding.

Supported tabular data types:

* list-of-lists or another iterable of iterables

* list of named tuples (usually used with headers="keys")

* list of dicts (usually used with headers="keys")

* list of OrderedDicts (usually used with headers="keys")

* list of dataclasses (usually used with headers="keys")

* 2D NumPy arrays

* NumPy record arrays (usually used with headers="keys")

* dict of iterables (usually used with headers="keys")

* pandas.DataFrame (usually used with headers="keys")

The first row can be used as headers if headers="firstrow",
column indices can be used as headers if headers="keys".

If showindex="default", show row indices of the pandas.DataFrame.
If showindex="always", show row indices for all types of data.
If showindex="never", don't show row indices for all types of data.
If showindex is an iterable, show its values as row indices.

z

To build a table python-tabulate requires two-dimensional data like a list of lists or similar.
Did you forget a pair of extra [] or ',' in ()?Nkeysrh   r  r   always:Nrc   Nz7tabular data doesn't appear to be a dict or a DataFramedtype_fieldsfirstrowr(   NNz6headers for a list of dicts is not a dict or a keyworddescriptionfetchonerowcountc                 >    \        V 4      '       d   V # \        V 4      # r   )r.   r)   )r|   s   &r   rF  )_normalize_tabular_data.<locals>.<lambda>h  s    #6q#9#9aFtAwFr   neverr   )r   r  T)(r   r   r)   r  callablerh   r  izip_longestr   r  namer   r   r"   r  namesr*   tupler  setr]  updater   adddictrY   r  dataclassesis_dataclassfieldsr.   getattrranger!   r   r  r   r   r  r=  )tabular_datar   	showindexerr_msgr  r  r   valsr+   	uniq_keys	firstdictkcolumnfieldfield_namesr   showindex_is_a_strheaders_pads   &&&               r   _normalize_tabular_datar    s   D W
	< 
 E|V$$x)H)HL''(($$&D) ,"5"5"78 \7++%D88 &&++7l0055t<<+1166DH , 2 2 7 78DH&&D++,E)-.#DID.DVWWf3sD>*G	%%D fTGvg..""((( #((..GvD	A47E**Q++ 3sDGOO45GY]wtAw77GDGX<V<VID*$'*4y1}DG"	INN,-  &BxA)A!a(	 $  & GT**6:;d;;q,d;s301J&t9q=<@ADqy}}Q2DGA"3sG#45G G L  ;??$3.AWWQZ.$D?D vm44j11j11 0</G/GH/GVayy/GGHG #D	A((a11 4?3E3Ed1g3NO3N%::3NKO& %    C /s33 /::kWS_k:    D 3t9q=3sE#d1g,$789G *TQQxj4Q=0G"IE1gGs3()Bx	J	3sG$%GFMND iS%L8I%"3!$.	Iu	%	%.@!$Y8	Ix	(	(1C!$2	h	5#3#3<N=s4y)*E!$.	g	eI&6&6?Q K3t9q=!Sa\CL89$$w.+%%Q   w- $  )(()" /  	%G$$	%P < B /? I P
 ;sw   ^6 # _ _-_2 ``'`/```!`&2`0`+ 	`06___*2`	`+`0c           
         \        V 4      '       d   \        V ^ ,          4      pM^ p\        W&R4      p. pV  EF7  p. p	\        WV4       EF  w  rp\        V
4      '       d   V'       d   V	P	                  V
4       K3  Ve   \        VVVR7      pV
f   TM<V
R8X  g   \        V
4      '       d   \        V
4      M\        \        W4      ! V
4      4      pVP                  4        Uu. uF:  pVP                  4       R8w  g   K  RP                  VP                  V4      4      NK<  	  ppV	P	                  RP                  V4      4       K  V	P	                  V
4       EK  	  VP	                  V	4       EK:  	  V# u upi )rc   T)rP   break_long_wordsbreak_on_hyphensr   r}   )r*   _expand_iterablerG   r  r   _CustomTextWrapr"   r  rc  r#   rF   wrap)list_of_listsrI   	numparsesr  r  r  num_colsresultr+   r   r   rP   r  wrappercasted_celllinewrappeds   &&&&&&           r   _wrap_text_to_colwidthsr    sW    =}Q'( d;IF%(%C!D8t$ )%5%5 |   2:4 D	 t!6t!<=  !, 6 6 8 8zz|r) 2DIIgll401 8  
 tyy12t$? &D@ 	gE H Ms   #E5?$E5c                h    \        V \        4      '       d   V P                  WR7      # \        V 4      # )a  
A type safe wrapper for converting a bytestring to str. This is essentially just
a wrapper around .decode() intended for use with things like map(), but with some
specific behavior:

1. if the given parameter is not a bytestring, it is returned unmodified
2. decode() is called for the given parameter and assumes utf8 encoding, but the
   default error behavior is changed from 'strict' to 'ignore'

>>> repr(_to_str(b'foo'))
"'foo'"

>>> repr(_to_str('foo'))
"'foo'"

>>> repr(_to_str(42))
"'42'"

)encodingerrors)r   r   r   r"   )r  r  r  s   &&&r   _to_strr    s+    ( !Uxxx99q6Mr   c                l  a9 V f   . p \        WVR7      w  ppp\        V4      w  ppVe   \        V4      \        J d   \	        V4      p\        V4      '       d   \        V^ ,          4      pM^ p\        V\        4      '       d   \        VVV4      pM\        VVR4      p\        V	V4      p\        VVVVVVR7      pVe|   V'       d   \        V^ ,          4      M
\        V4      p\        V\        4      '       d   \        VVV4      pM\        VVR4      p\        V	V4      p\        V.VVVVVR7      ^ ,          pVR8X  d   \        VV4      w  pp\        pVR8X  d$   ^ pRp	V\        8X  d   RMTpV\        8X  d   RMTpMV\        8X  d   RMTpV\        8X  d   R	MTpVR
8X  d   R	p
R	pRP                  \        \!        \"        V4      \        P$                  ! R V 4       4      4      4      p\&        P)                  V4      RJp\*        RJ;'       d    \,        p\        V\.        4      '       g5   V\0        9   d*   \3        V4      '       d   \0        P5                  W"4      pRpMRp\7        VVV4      o9\	        \9        V!  4      p\        V	\        V4      4      p\;        VV4       UU u. uF  w  pp \=        VV R7      NK  	  p!pp \        V\>        4      '       d   \        V4      V.,          p"MZ\	        V4      p"\        V"4      \        V4      8  d7   V"PA                  \        V4      \        V"4      ,
          \B        .,          4       \        V\>        4      '       d   \        V4      V.,          p#MZ\	        V4      p#\        V#4      \        V4      8  d7   V#PA                  \        V4      \        V#4      ,
          \D        .,          4       \        V\>        4      '       d   \        V4      V.,          p$MZ\	        V4      p$\        V$4      \        V4      8  d7   V$PA                  \        V4      \        V$4      ,
          \F        .,          4       \;        VV!V"V#V$4       U%U&U'U(U)U*u. uF)  w  p%p&p'p(p)V% U*u. uF  p*\I        V*V&V'V(V)V4      NK  	  up*NK+  	  pp)p(p'p&p%p*V
e   V
.\        V4      ,          p+M$V! U&u. uF  p&V&\        \J        39   d   TMTNK  	  p+p&Ve   \        V\L        4      '       g   Q h\        V\>        4      '       d3   \N        PP                  ! RV U%u. uF  p%V%NK  	  up% RV RV R2^R7       \S        V4       F&  w  p,p-V,\        V+4      8  g    MV-R8w  g   K!  V-V+V,&   K(  	  V'       d    V U.u. uF  p.S9! V.4      V,           NK  	  up.M^ .\        V4      ,          p/V+PU                  4       p0VR
8X  d   R	.\        V4      ,          p0\;        VV0V/4       U%U1U2u. uF  w  p%p1p2\W        V%V1V2VVVV4      NK  	  pp1p%p2Rp3V'       Ed   T;'       g    R..\        V4      ,          p4Ve   V.\        V44      ,          p3MT+;'       g    V.\        V4      ,          p3Ve   \        V\L        4      '       g   Q h\        V\>        4      '       d3   \N        PP                  ! RV U%u. uF  p%V%NK  	  up% RV RV R2^R7       \S        V4       FT  w  p,p-VV,,           p5V5\        V34      8  g    M7V-R8X  d   V5\        V+4      8  d   V+V5,          V3V5&   KF  V-R8w  g   KO  V-V3V5&   KV  	  \;        V/V44       U2U%u. uF%  w  p2p%\Y        V2\Y        V93R lV% 4       4      4      NK'  	  p/p2p%\;        VV3V/4       U.U1U2u. uF  w  p.p1p2\[        V.V1V2S9! V.4      VS94      NK  	  pp1p.p2\	        \;        V!  4      p6M6V U%u. uF  p%\Y        V93R lV% 4       4      NK  	  p/p%\	        \;        V!  4      p6\        V\.        4      '       g"   \\        P5                  V\\        R,          4      p\        V\>        4      '       d   TMRp7\        V\        V64      V74      p8\_        V6V4       \a        VVV3V6V/V+VV8R7      # u up pi u up*i u up*p)p(p'p&p%i u up&i u up%i u up.i u up2p1p%i u up%i u up%p2i u up2p1p.i u up%i )uK  Format a fixed width table for pretty printing.

>>> print(tabulate([[1, 2.34], [-56, "8.999"], ["2", "10001"]]))
---  ---------
  1      2.34
-56      8.999
  2  10001
---  ---------

The first required argument (`tabular_data`) can be a
list-of-lists (or another iterable of iterables), a list of named
tuples, a dictionary of iterables, an iterable of dictionaries,
an iterable of dataclasses, a two-dimensional NumPy array,
NumPy record array, or a Pandas' dataframe.


Table headers
-------------

To print nice column headers, supply the second argument (`headers`):

  - `headers` can be an explicit list of column headers
  - if `headers="firstrow"`, then the first row of data is used
  - if `headers="keys"`, then dictionary keys or column indices are used

Otherwise a headerless table is produced.

If the number of headers is less than the number of columns, they
are supposed to be names of the last columns. This is consistent
with the plain-text format of R and Pandas' dataframes.

>>> print(tabulate([["sex","age"],["Alice","F",24],["Bob","M",19]],
...       headers="firstrow"))
       sex      age
-----  -----  -----
Alice  F         24
Bob    M         19

By default, pandas.DataFrame data have an additional column called
row index. To add a similar column to all other types of data,
use `showindex="always"` or `showindex=True`. To suppress row indices
for all types of data, pass `showindex="never" or `showindex=False`.
To add a custom row index column, pass `showindex=some_iterable`.

>>> print(tabulate([["F",24],["M",19]], showindex="always"))
-  -  --
0  F  24
1  M  19
-  -  --


Column and Headers alignment
----------------------------

`tabulate` tries to detect column types automatically, and aligns
the values properly. By default it aligns decimal points of the
numbers (or flushes integer numbers to the right), and flushes
everything else to the left. Possible column alignments
(`numalign`, `stralign`) are: "right", "center", "left", "decimal"
(only for `numalign`), and None (to disable alignment).

`colglobalalign` allows for global alignment of columns, before any
    specific override from `colalign`. Possible values are: None
    (defaults according to coltype), "right", "center", "decimal",
    "left".
`colalign` allows for column-wise override starting from left-most
    column. Possible values are: "global" (no override), "right",
    "center", "decimal", "left".
`headersglobalalign` allows for global headers alignment, before any
    specific override from `headersalign`. Possible values are: None
    (follow columns alignment), "right", "center", "left".
`headersalign` allows for header-wise override starting from left-most
    given header. Possible values are: "global" (no override), "same"
    (follow column alignment), "right", "center", "left".

Note on intended behaviour: If there is no `tabular_data`, any column
    alignment argument is ignored. Hence, in this case, header
    alignment cannot be inferred from column alignment.

Table formats
-------------

`intfmt` is a format specification used for columns which
contain numeric data without a decimal point. This can also be
a list or tuple of format strings, one per column.

`floatfmt` is a format specification used for columns which
contain numeric data with a decimal point. This can also be
a list or tuple of format strings, one per column.

`None` values are replaced with a `missingval` string (like
`floatfmt`, this can also be a list of values for different
columns):

>>> print(tabulate([["spam", 1, None],
...                 ["eggs", 42, 3.14],
...                 ["other", None, 2.7]], missingval="?"))
-----  --  ----
spam    1  ?
eggs   42  3.14
other   ?  2.7
-----  --  ----

Various plain-text table formats (`tablefmt`) are supported:
'plain', 'simple', 'grid', 'pipe', 'orgtbl', 'rst', 'mediawiki',
'latex', 'latex_raw', 'latex_booktabs', 'latex_longtable' and tsv.
Variable `tabulate_formats`contains the list of currently supported formats.

"plain" format doesn't use any pseudographics to draw tables,
it separates columns with a double space:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                 ["strings", "numbers"], "plain"))
strings      numbers
spam         41.9999
eggs        451

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="plain"))
spam   41.9999
eggs  451

"simple" format is like Pandoc simple_tables:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                 ["strings", "numbers"], "simple"))
strings      numbers
---------  ---------
spam         41.9999
eggs        451

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="simple"))
----  --------
spam   41.9999
eggs  451
----  --------

"grid" is similar to tables produced by Emacs table.el package or
Pandoc grid_tables:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "grid"))
+-----------+-----------+
| strings   |   numbers |
+===========+===========+
| spam      |   41.9999 |
+-----------+-----------+
| eggs      |  451      |
+-----------+-----------+

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="grid"))
+------+----------+
| spam |  41.9999 |
+------+----------+
| eggs | 451      |
+------+----------+

"simple_grid" draws a grid using single-line box-drawing
characters:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "simple_grid"))
┌───────────┬───────────┐
│ strings   │   numbers │
├───────────┼───────────┤
│ spam      │   41.9999 │
├───────────┼───────────┤
│ eggs      │  451      │
└───────────┴───────────┘

"rounded_grid" draws a grid using single-line box-drawing
characters with rounded corners:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "rounded_grid"))
╭───────────┬───────────╮
│ strings   │   numbers │
├───────────┼───────────┤
│ spam      │   41.9999 │
├───────────┼───────────┤
│ eggs      │  451      │
╰───────────┴───────────╯

"heavy_grid" draws a grid using bold (thick) single-line box-drawing
characters:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "heavy_grid"))
┏━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ strings   ┃   numbers ┃
┣━━━━━━━━━━━╋━━━━━━━━━━━┫
┃ spam      ┃   41.9999 ┃
┣━━━━━━━━━━━╋━━━━━━━━━━━┫
┃ eggs      ┃  451      ┃
┗━━━━━━━━━━━┻━━━━━━━━━━━┛

"mixed_grid" draws a grid using a mix of light (thin) and heavy (thick) lines
box-drawing characters:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "mixed_grid"))
┍━━━━━━━━━━━┯━━━━━━━━━━━┑
│ strings   │   numbers │
┝━━━━━━━━━━━┿━━━━━━━━━━━┥
│ spam      │   41.9999 │
├───────────┼───────────┤
│ eggs      │  451      │
┕━━━━━━━━━━━┷━━━━━━━━━━━┙

"double_grid" draws a grid using double-line box-drawing
characters:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "double_grid"))
╔═══════════╦═══════════╗
║ strings   ║   numbers ║
╠═══════════╬═══════════╣
║ spam      ║   41.9999 ║
╠═══════════╬═══════════╣
║ eggs      ║  451      ║
╚═══════════╩═══════════╝

"fancy_grid" draws a grid using a mix of single and
double-line box-drawing characters:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "fancy_grid"))
╒═══════════╤═══════════╕
│ strings   │   numbers │
╞═══════════╪═══════════╡
│ spam      │   41.9999 │
├───────────┼───────────┤
│ eggs      │  451      │
╘═══════════╧═══════════╛

"colon_grid" is similar to "grid" but uses colons only to define
columnwise content alignment, without whitespace padding,
similar to the alignment specification of Pandoc `grid_tables`:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "colon_grid"))
+-----------+-----------+
| strings   | numbers   |
+:==========+:==========+
| spam      | 41.9999   |
+-----------+-----------+
| eggs      | 451       |
+-----------+-----------+

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "colon_grid",
...                colalign=["right", "left"]))
+-----------+-----------+
| strings   | numbers   |
+==========:+:==========+
| spam      | 41.9999   |
+-----------+-----------+
| eggs      | 451       |
+-----------+-----------+

"outline" is the same as the "grid" format but doesn't draw lines between rows:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "outline"))
+-----------+-----------+
| strings   |   numbers |
+===========+===========+
| spam      |   41.9999 |
| eggs      |  451      |
+-----------+-----------+

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="outline"))
+------+----------+
| spam |  41.9999 |
| eggs | 451      |
+------+----------+

"simple_outline" is the same as the "simple_grid" format but doesn't draw lines between rows:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "simple_outline"))
┌───────────┬───────────┐
│ strings   │   numbers │
├───────────┼───────────┤
│ spam      │   41.9999 │
│ eggs      │  451      │
└───────────┴───────────┘

"rounded_outline" is the same as the "rounded_grid" format but doesn't draw lines between rows:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "rounded_outline"))
╭───────────┬───────────╮
│ strings   │   numbers │
├───────────┼───────────┤
│ spam      │   41.9999 │
│ eggs      │  451      │
╰───────────┴───────────╯

"heavy_outline" is the same as the "heavy_grid" format but doesn't draw lines between rows:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "heavy_outline"))
┏━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ strings   ┃   numbers ┃
┣━━━━━━━━━━━╋━━━━━━━━━━━┫
┃ spam      ┃   41.9999 ┃
┃ eggs      ┃  451      ┃
┗━━━━━━━━━━━┻━━━━━━━━━━━┛

"mixed_outline" is the same as the "mixed_grid" format but doesn't draw lines between rows:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "mixed_outline"))
┍━━━━━━━━━━━┯━━━━━━━━━━━┑
│ strings   │   numbers │
┝━━━━━━━━━━━┿━━━━━━━━━━━┥
│ spam      │   41.9999 │
│ eggs      │  451      │
┕━━━━━━━━━━━┷━━━━━━━━━━━┙

"double_outline" is the same as the "double_grid" format but doesn't draw lines between rows:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "double_outline"))
╔═══════════╦═══════════╗
║ strings   ║   numbers ║
╠═══════════╬═══════════╣
║ spam      ║   41.9999 ║
║ eggs      ║  451      ║
╚═══════════╩═══════════╝

"fancy_outline" is the same as the "fancy_grid" format but doesn't draw lines between rows:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "fancy_outline"))
╒═══════════╤═══════════╕
│ strings   │   numbers │
╞═══════════╪═══════════╡
│ spam      │   41.9999 │
│ eggs      │  451      │
╘═══════════╧═══════════╛

"pipe" is like tables in PHP Markdown Extra extension or Pandoc
pipe_tables:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "pipe"))
| strings   |   numbers |
|:----------|----------:|
| spam      |   41.9999 |
| eggs      |  451      |

"presto" is like tables produce by the Presto CLI:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "presto"))
 strings   |   numbers
-----------+-----------
 spam      |   41.9999
 eggs      |  451

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="pipe"))
|:-----|---------:|
| spam |  41.9999 |
| eggs | 451      |

"orgtbl" is like tables in Emacs org-mode and orgtbl-mode. They
are slightly different from "pipe" format by not using colons to
define column alignment, and using a "+" sign to indicate line
intersections:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "orgtbl"))
| strings   |   numbers |
|-----------+-----------|
| spam      |   41.9999 |
| eggs      |  451      |


>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="orgtbl"))
| spam |  41.9999 |
| eggs | 451      |

"rst" is like a simple table format from reStructuredText; please
note that reStructuredText accepts also "grid" tables:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
...                ["strings", "numbers"], "rst"))
=========  =========
strings      numbers
=========  =========
spam         41.9999
eggs        451
=========  =========

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="rst"))
====  ========
spam   41.9999
eggs  451
====  ========

"mediawiki" produces a table markup used in Wikipedia and on other
MediaWiki-based sites:

>>> print(tabulate([["strings", "numbers"], ["spam", 41.9999], ["eggs", "451.0"]],
...                headers="firstrow", tablefmt="mediawiki"))
{| class="wikitable" style="text-align: left;"
|+ <!-- caption -->
|-
! strings   !! style="text-align: right;"|   numbers
|-
| spam      || style="text-align: right;"|   41.9999
|-
| eggs      || style="text-align: right;"|  451
|}

"html" produces HTML markup as an html.escape'd str
with a ._repr_html_ method so that Jupyter Lab and Notebook display the HTML
and a .str property so that the raw HTML remains accessible
the unsafehtml table format can be used if an unescaped HTML format is required:

>>> print(tabulate([["strings", "numbers"], ["spam", 41.9999], ["eggs", "451.0"]],
...                headers="firstrow", tablefmt="html"))
<table>
<thead>
<tr><th>strings  </th><th style="text-align: right;">  numbers</th></tr>
</thead>
<tbody>
<tr><td>spam     </td><td style="text-align: right;">  41.9999</td></tr>
<tr><td>eggs     </td><td style="text-align: right;"> 451     </td></tr>
</tbody>
</table>

"latex" produces a tabular environment of LaTeX document markup:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="latex"))
\begin{tabular}{lr}
\hline
 spam &  41.9999 \\
 eggs & 451      \\
\hline
\end{tabular}

"latex_raw" is similar to "latex", but doesn't escape special characters,
such as backslash and underscore, so LaTeX commands may embedded into
cells' values:

>>> print(tabulate([["spam$_9$", 41.9999], ["\\emph{eggs}", "451.0"]], tablefmt="latex_raw"))
\begin{tabular}{lr}
\hline
 spam$_9$    &  41.9999 \\
 \emph{eggs} & 451      \\
\hline
\end{tabular}

"latex_booktabs" produces a tabular environment of LaTeX document markup
using the booktabs.sty package:

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="latex_booktabs"))
\begin{tabular}{lr}
\toprule
 spam &  41.9999 \\
 eggs & 451      \\
\bottomrule
\end{tabular}

"latex_longtable" produces a tabular environment that can stretch along
multiple pages, using the longtable package for LaTeX.

>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="latex_longtable"))
\begin{longtable}{lr}
\hline
 spam &  41.9999 \\
 eggs & 451      \\
\hline
\end{longtable}


Number parsing
--------------
By default, anything which can be parsed as a number is a number.
This ensures numbers represented as strings are aligned properly.
This can lead to weird results for particular strings such as
specific git SHAs e.g. "42992e1" will be parsed into the number
429920 and aligned as such.

To completely disable number parsing (and alignment), use
`disable_numparse=True`. For more fine grained control, a list column
indices is used to disable number parsing only on those columns
e.g. `disable_numparse=[0, 2]` would disable number parsing only on the
first and third columns.

Column Widths and Auto Line Wrapping
------------------------------------
Tabulate will, by default, set the width of each column to the length of the
longest element in that column. However, in situations where fields are expected
to reasonably be too long to look good as a single line, tabulate can help automate
word wrapping long fields for you. Use the parameter `maxcolwidths` to provide a
list of maximal column widths:

>>> print(tabulate(           [('1', 'John Smith',             'This is a rather long description that might look better if it is wrapped a bit')],           headers=("Issue Id", "Author", "Description"),           maxcolwidths=[None, None, 30],           tablefmt="grid"          ))
+------------+------------+-------------------------------+
|   Issue Id | Author     | Description                   |
+============+============+===============================+
|          1 | John Smith | This is a rather long         |
|            |            | description that might look   |
|            |            | better if it is wrapped a bit |
+------------+------------+-------------------------------+

Header column width can be specified in a similar way using `maxheadercolwidths`.

N)r  )r  r  r  r  r   r   Tr2   r5   r3   r   r   c              3   B   "   T F  p\        \        V4      x  K  	  R # 5ir   )r   r  )r?   r+   s   & r   rA   tabulate.<locals>.<genexpr>E	  s     K]cGS 1 1]s   F)r  z*As a string, `colalign` is interpreted as z". Did you mean `colglobalalign = "z"` or `colalign = ("z",)`?)
stacklevelglobalr   z.As a string, `headersalign` is interpreted as z&. Did you mean `headersglobalalign = "z"` or `headersalign = ("samec              3   4   <"   T F  pS! V4      x  K  	  R # 5ir   r6   r?   clrL  s   & r   rA   r  	  s     32(2,,   c              3   4   <"   T F  pS! V4      x  K  	  R # 5ir   r6   r  s   & r   rA   r  	  s     2""r  r   )	rowaligns)1r  r  r!   r  r)   r*   r   r   r  _expand_numparser  r   MIN_PADDING_DEFAULT_ALIGNrF   r
   r   r  from_iterabler+  r6  r0  r1  r   multiline_formatsr9  rY   rM  r  rG   rv  r"   r]  _DEFAULT_FLOATFMT_DEFAULT_INTFMT_DEFAULT_MISSINGVALr  r   r   warningswarnr  copyrm  r=  r  _table_formatsr  _format_table):r  r   tablefmtr  r  numalignstralignr  r  disable_numparsecolglobalalignr   rP  maxcolwidthsheadersglobalalignheadersalignrowalignmaxheadercolwidthsr  r  r  r  r  r  r  min_padding
plain_textr  rJ  rK  colscolnpcoltypesfloat_formatsint_formatsmissing_valsr^   ctfl_fmtint_fmtmiss_vrf   alignsidxr7   r  	minwidthsaligns_copyr@   minwaligns_headerst_colshidxr   
ra_defaultr  rL  s:   &&&&&&&&&&&&&&&&&&&&                                     @r   r   r     ss   z *A+'M7K '?}&M#M#&-L}=+,HHlC((+L(LQL+L(DIL$%5x@	/!--
 %,93}Q'(s7|(#..!1"H.@" "22DhPT!U$%5x@	)I!--
  5!9-!Qw K8'>98x'>98x (N :9%76X
 <# ! K]KK	
J  &&z2$>Md*>>x--))*%%$((</?NH m,-D !13t9=I>A$	>RS>R73S2.>RHS(C  D	%
 
 X}D	)  #d)c-.@"@EVDW!WX&#$i#
 
 6l{c$i'D	C,< <@QQR*c""4yJ</J'|s4y(TS->!>CVBW WX /2(M;/
 /
*Ar67F JKKAB	?K/
 	  ! !CI-IQR2bS%L0(h>R(H----h$$MM<=RAa=R<S T33;*<PQYPZZ_a
 $H-JCV$("#s	 . 9@G4Gq!{	"	"G4aS3t9_  ++-K <hT* dK; <JAq$ 		
 < 	  Nw..2$#g,.)01CK?N#@@zCL'@N#lH5555,,,DQ]E^Q]AaQ]E^D_ `;;G. I,,8>@  !	 (5
U"S(c.11f_F);+1$<N4(h&+0N4( 6 y&1
1a c33341 	 
 "'>9E
E
1d !Qhqk<JE 	 
 CJ<@ADqS222D	ACJh,,!%%hx0HI'#66DJ 3t9jAIt%56	 	m T0 	L S >S 	56 F_

 BsN   +a4)a?8a:a?;b	"b
 b)b0b
?+b$>#b*<b1:a?c                ~    \        V \        4      '       d   R.V,          pV  F  pRW#&   K	  	  V# V '       * .V,          # )a*  
Return a list of bools of length `column_count` which indicates whether
number parsing should be used on each column.
If `disable_numparse` is a list of indices, each of those indices are False,
and everything else is True.
If `disable_numparse` is a bool, then the returned list is all the same.
TF)r   r   )r  column_countr  r  s   &&  r   r  r  	  sG     "H--F\)	%E$I &$$%44r   c                    \        V \        4      '       d7   \        V \        4      '       g!   W.V\        V 4      ,
          ,          ,           # V.V,          # )aA  
Expands the `original` argument to return a return a list of
length `num_desired`. If `original` is shorter than `num_desired`, it will
be padded with the value in `default`.
If `original` is not a list to begin with (i.e. scalar value) a list of
length `num_desired` completely populated with `default will be returned
)r   r   r"   r*   )originalnum_desiredr   s   &&&r   r  r  	  sC     (H%%j3.G.G){S]'BCCCy;&&r   c                     V '       d;   V \         8X  d   \         # R V,          pV  Uu. uF  q2V,           V,           NK  	  ppV# V # u upi )rX   )r$   )cellsr   padr   padded_cellss   &&   r   _pad_rowr!  	  sJ    O#""Gm5:;UTd
S((U; <s   Ac                d    Vw  r#pW#P                  V 4      ,           V,           P                  4       # )z7Format row according to DataRow format without padding.)rF   rZ   )r   r   beginsepends   &&   r   r   r   
  s+    OEHH\**S088::r   c                `    V'       g   R# \        V4      '       d
   V! WV4      # \        W4      # )z5Return a string which represents a row of data cells.Nr  r   )r   rI   rJ   r   s   &&&&r   
_build_rowr(  
  s+    ly99 66r   c                 <    V P                  \        WW44      4       V # r   )r   r(  )linesr   rI   rJ   r   r   s   &&&&&&r   _append_basic_rowr+  
  s    	LLLYGHLr   c                     V\        V 4      ,
          pR V,          .pVR8X  d   WT,          V ,           # VR8X  d.   V^,          pWF,
          pWe,          V ,           Wu,          ,           # WV,          ,           # )rX   bottomr2   )r*   )
text_lines	num_linescolumn_widthrow_alignmentdelta_linesblank	top_deltabottom_deltas   &&&&    r   _align_cell_veriticallyr6  
  sq    c*o-K< E "Z//	(	"1$	". :-0DDDK///r   c           
         V Uu. uF  qw^V,          ,
          NK  	  ppV U	u. uF  qP                  4       NK  	  p
p	\        \        \        V
4      4      p\	        W4       UUu. uF  w  r\        WWv4      NK  	  p
pp\        V4       UUu. uF  q Uu. uF  qV,          NK  	  upNK  	  pppV F  p\        W4      p\        V VWV4       K  	  V # u upi u up	i u uppi u upi u uppi )   )	rc  r=  r   r*   rG   r6  r  r!  r+  )r*  padded_multiline_cellspadded_widthsrJ   r   r  r   r9   rI   r^   cells_linesnlinesr  ilines_cellsln	padded_lns   &&&&&&&          r   _append_multiline_rowrA  )
  s     '44mQWmI4+AB+Aa<<>+AKBS+&'F 00EB 	 A80   ;@-H-QK0KbqEEK0-KHR%	%I&I  L! 5B 1Hs(   CC$CC(C#%C(#C(c                    V'       g   R# \        V4      '       d	   V! W4      # Vw  r4rVV  Uu. uF  qtV,          NK  	  pp\        WWV34      # u upi )z3Return a string which represents a horizontal line.Nr'  )	rI   rJ   linefmtr#  fillr$  r%  r9   r  s	   &&&      r   _build_linerE  ?
  sU    y,, 'S#,-9a9- (9:: .s   Ac                 <    V P                  \        WV4      4       V # r   )r   rE  )r*  rI   rJ   rC  s   &&&&r   _append_linerG  K
  s    	LLY7;<Lr   c                   :   a  ] tR tRt o RtR t]R 4       tRtV t	R# )JupyterHTMLStriP
  zQWrap the string with a _repr_html_ method so that Jupyter
displays the HTML tablec                    V # r   r6   selfs   &r   _repr_html_JupyterHTMLStr._repr_html_T
  s    r   c                    V # )z>add a .str property so that the raw string is still accessibler6   rK  s   &r   r"   JupyterHTMLStr.strW
  s	     r   r6   N)
__name__
__module____qualname____firstlineno____doc__rM  propertyr"   __static_attributes____classdictcell____classdict__s   @r   rI  rI  P
  s#       r   rI  c           
        . pV'       d   V P                   '       d   V P                   M. p	V P                  p
V P                  pV Uu. uF  q^V
,          ,           NK  	  ppV'       d   R p\        \        V
R7      pM\
        p\        pV! W4      pV P                  '       d   RV	9  d   \        WWPP                  4       V'       d;   V! VVWV4       V P                  '       d   RV	9  d   \        WWPP                  4       V'       d   V P                  '       d   RV	9  d   \        VRR V4       FF  w  ppV\        8w  d    V! VV! VV
4      VVV P                  VR7       \        WWPP                  4       KH  	  V! VV! VR,          V
4      VVV P                  VR,          R7       MV P                  ;'       gK    V P                  ;'       g7    V P                  ;'       g#    V P                  ;'       g    \        RRRR4      pV F>  p\!        V4      '       d   \        WVV4       K#  V! W! VV
4      WV P                  4       K@  	  V P                  '       d   R	V	9  d   \        WWPP                  4       V'       g	   V'       d4   R
P#                  V4      pV P                  \$        8X  d   \'        V4      # V# R# u upi )z1Produce a plain-text representation of the table.c                     V # r   r6   )r+   r   s   &&r   rF  _format_table.<locals>.<lambda>i
  s    3r   )r  r   r   r   N)r   r   r   r}   r  )r   r   r   r   rA  r!  r+  r   rG  r   r   rG   r$   r   r   r   r.   rF   rm   rI  )r   r   headersalignsr   rI   rJ   rK  r  r*  hiddenr  r   r9   r:  pad_row
append_rowpadded_headersr+   ralignseparating_lineoutputs   &&&&&&&&             r   r  r  ]
  sl    E&-#2F2F2FS!!RF
++CI,56Iq!c'kkIM6 	 2<
&
W*N
}}}F2U9mmD5.-	R#4F#By:M:MN###(9(GtCRy)4KCo%C%!KK# y:M:MN 5 	DHc"KKr]	
  $ $""$ $}}$ $ }}$ $ BB# 	 C #3''U9oN73,m  }}}F2U9mmD$5!==<<!&))MM 7s   Kc                   L   a  ] tR tRt o RtR t]R 4       tR tR t	R t
RtV tR	# )
r  i
  aG  A custom implementation of CPython's textwrap.TextWrapper. This supports
both wide characters (Korea, Japanese, Chinese)  - including mixed string.
For the most part, the `_handle_long_word` and `_wrap_chunks` functions were
copy pasted out of the CPython baseline, and updated with our custom length
and line appending logic.
c                j    . V n         R V n        \        P                  P                  ! V .VO5/ VB  R # r   )_active_codes	max_linestextwrapTextWrapper__init__)rL  r   kwargss   &*,r   rl  _CustomTextWrap.__init__
  s/    %%d<T<V<r   c                r    \        V 4      p\        '       d   \        P                  ! V4      # \        V4      # )ziCustom len that gets console column width for wide
and non-wide characters as well as ignores color codes)r  r0  r2  r*   )r`  strippeds   & r   _len_CustomTextWrap._len
  s.     t$7##H--x= r   c                   \         P                  V4       Uu. uF  q3NK  	  ppV Uu. uF;  qUP                  VP                  4       ^ ,          VP                  4       ^,           NK=  	  ppRP	                  V P
                  4      V,           pV F2  pV\        8w  d   V P
                  P                  V4       K+  . V n        K4  	  \        V P
                  4      ^ 8  d   V\        ,           pVP                  V4       R# u upi u upi )zAdds a new line to the list of lines the text is being wrapped into
This function will also track any ANSI color codes in this string as well
as add any colors from previous lines order to preserve the same formatting
as a single unwrapped string.
r   N)	r+  finditerr   spanrF   rh  _ansi_color_reset_coder   r*   )rL  r*  new_linexcode_matchescodecolor_codess   &&&    r   _update_lines_CustomTextWrap._update_lines
  s     $/#7#7#AB#Aa#ABEQ
EQTKK		AQ8\ 	 

 774--.9D--""))$/%'"	   t!!"Q&"88HX' C
s   
C?ADc                   V^8  d   ^pMWC,
          pV P                   '       Ed&   V^ 8  Ed   VR,          p^p\        V4      pV\        V4      8:  d%   V P                  VRV 4      V8:  d   V^,           pK4  ^ p	^ p
\        P                  V4      e   \        P                  V4       Fg  w  p  p\        V4      pVWjWy,           V,           ^,
           9   g   K2  W,          p	\        P                  WjR 4      pWP                  4       ,          p
Ki  	  VP                  VRWy,           ^,
           4       WgV	,           ^,
          R VR&   R# V'       g"   VP                  VP                  4       4       R# R# )z_handle_long_word(chunks : [string],
                     cur_line : [string],
                     cur_len : int, width : int)
Handle a chunk of text (most likely a word, not whitespace) that
is too long to fit in any line.
Nr  )
r  r  r*   rq  r+  r6  findallr%  r   pop)rL  reversed_chunkscur_linecur_lenrP   
space_leftchunkr=  stripped_chunktotal_escape_len
last_groupr|  r   
escape_lenfounds   &&&&&          r   _handle_long_word!_CustomTextWrap._handle_long_word
  s[    19JJ    Z!^ $B'EA(/NS((TYY~bq7I-Jj-XE J!!%(4&1&9&9%&@NE1a!$UJ a.BZ.ORS.STU )6( + 2 253E F"iik1
 'A OOE"<A$81$<=>"',<(<q(@(B"COB
 OOO//12 r   c                   . pV P                   ^ 8:  d   \        RV P                   ,          4      hV P                  e   V P                  ^8  d   V P                  pMV P                  pV P                  V4      V P                  V P                  P                  4       4      ,           V P                   8  d   \        R4      hVP                  4        V'       Ed   . p^ pV'       d   V P                  pMV P                  pV P                   V P                  V4      ,
          pV P                  '       d(   VR,          P                  4       R8X  d   V'       d   VR V'       dP   V P                  VR,          4      pWW,           V8:  d*   VP                  VP                  4       4       WW,          pKV   V'       dO   V P                  VR,          4      V8  d2   V P                  WWV4       \        \        V P
                  V4      4      pV P                  '       dF   V'       d>   VR,          P                  4       R8X  d"   WPP                  VR,          4      ,          pVR V'       g   EK  V P                  eo   \!        V4      ^,           V P                  8  gN   V'       d@   V P                  '       d^   \!        V4      ^8X  dN   V^ ,          P                  4       '       g1   WV8:  d+   V P#                  W#RP%                  V4      ,           4       EK>  V'       d   VR,          P                  4       '       dm   WPP                  V P                  4      ,           V8:  dG   VP                  V P                  4       V P#                  W#RP%                  V4      ,           4         V# WPP                  VR,          4      ,          pVR K  V'       dp   VR,          P'                  4       pV P                  V4      V P                  V P                  4      ,           V P                   8:  d   WP                  ,           VR&    V# V P#                  W#V P                  P                  4       ,           4        V# V# )aN  _wrap_chunks(chunks : [string]) -> [string]
Wrap a sequence of text chunks and return a list of lines of
length 'self.width' or less.  (If 'break_long_words' is false,
some lines may be longer than this.)  Chunks correspond roughly
to words and the whitespace between them: each chunk is
indivisible (modulo 'break_long_words'), but a line break can
come between any two chunks.  Chunks should not have internal
whitespace; ie. a chunk is either all whitespace or a "word".
Whitespace chunks will be removed from the beginning and end of
lines, but apart from that whitespace is preserved.
zinvalid width %r (must be > 0)z#placeholder too large for max widthr   r  )rP   r   ri  subsequent_indentinitial_indentrq  placeholderlstripreversedrop_whitespacer#   r   r  r  sumr   r*   r|  rF   rZ   )	rL  chunksr*  indentr  r  rP   	chunk_len	prev_lines	   &&       r   _wrap_chunks_CustomTextWrap._wrap_chunks  sY    ::?=

JKK>>%~~!//,,yy 499T-=-=-D-D-F#GG$**T !FGG 	f HG //,, JJ6!22E ###r
(8(8(:b(@U2J IIfRj1	 &%/OOFJJL1(G  $))F2J/%7&&vHc$))X67 ###Xb\5G5G5IR5O99Xb\22RLxNN*5zA~6"///K1, &q	 1 1( &&urwwx7H.HI"$RL..00 '))D4D4D*E E N$OOD,<,<= ..urwwx?P6PQ!   99Xb\#::$RL (-b	(8(8(:I $		) 4tyyAQAQ7R R#'::!. -68H8H,Hb	 %  **54;K;K;R;R;T2TUur   )rh  ri  N)rQ  rR  rS  rT  rU  rl  staticmethodrq  r|  r  r  rW  rX  rY  s   @r   r  r  
  s:     =
 ! !6/3nm mr   r  c                    ^ RI p \        P                  ! \        P                  4      p V P                  \
        P                  R,          R. RO4      w  r#. p\        p\        pRpRp	Rp
RpX F  w  rVR9   d   RpK  VR9   d   TpK  VR9   d   TpK&  VR9   d   TpK1  VR9   d   VP                  4       pKJ  VR9   dC   V\        9  d4   \        RV,          4       \        V4       \
        P                  ! ^4       Tp	K  VR9   d   Tp
K  VR9   g   K  \        V4       \
        P                  ! ^ 4       K  	  X'       g   \
        P                  .MTpVR8X  d   \
        P                  M\!        VR	4      ;_uu_ 4       pV Fo  pVR8X  d   \
        P                  p\#        V4      '       d   \%        VVV	V
VVVVR
7       K@  \!        V4      ;_uu_ 4       p\%        VVV	V
VVVVR
7       RRR4       Kq  	  RRR4       R#   T P                   d8   p\        T4       \        T4       \
        P                  ! ^4        Rp?ELRp?ii ; i  + '       g   i     K  ; i  + '       g   i     R# ; i)a  Usage: tabulate [options] [FILE ...]

Pretty-print tabular data.
See also https://github.com/astanin/python-tabulate

FILE                      a filename of the file with tabular data;
                          if "-" or missing, read data from stdin.

Options:

-h, --help                show this message
-1, --header              use the first row of data as a table header
-o FILE, --output FILE    print table to FILE (default: stdout)
-s REGEXP, --sep REGEXP   use a custom column separator (default: whitespace)
-F FPFMT, --float FPFMT   floating point number format (default: g)
-I INTFMT, --int INTFMT   integer point number format (default: "")
-f FMT, --format FMT      set output table format; supported formats:
                          plain, simple, grid, fancy_grid, pipe, orgtbl,
                          rst, mediawiki, html, latex, latex_raw,
                          latex_booktabs, latex_longtable, tsv
                          (default: simple)
Nr  zh1o:s:F:I:f:r   z\s+r0   r  z"%s is not a supported table formatr9   )r   r  r$  r  r  filer   )helprx   zoutput=zsep=zfloat=zint=z	colalign=zformat=)z-1z--header)z-oz--output)z-Fz--float)z-Iz--int)z-Cz
--colalign)z-fz--format)z-sz--sep)z-hz--help)getoptrj  dedent_mainrU  sysargvGetoptErrorprintexitr  r  r>  tabulate_formatsstdinstdoutopenr   _pprint_file)r  usageoptsr   r  r   r  r  r   r  r$  outfileoptr%   filesoutr   fobjs                     r   r  r    s   0 OOEMM*E]]HHRL	

$ G HFHH
CG
$$ G&&G%%HO#F(({{}H&&,,:UBCeHO#C$$%LHHQK+ ,  $SYYKE#~4+=	=	=ACxII{{#%%!%	 !WW  '!)!)% !)	 W  
>	=E  aed WW! 
>	=	=s<   ,H   AII*I I,III	II0	c                     V P                  4       pV U	u. uF>  qP                  4       '       g   K  \        P                  ! W9P	                  4       4      NK@  	  p
p	\        \        V
VVVVVR 7      VR7       R# u up	i ))r  r  r   )r  N)	readlinesr#   r   r>  rZ   r  r   )fobjectr   r  r$  r  r  r  r   r   r|   tables   &&&&&&&&   r   r  r    si    D04B1	&RXXc88:&EB		
 
 Cs
   A9(A9__main__)r   r  r   )r#  hliner$  r%  )r#  r$  r%  )r   )FF)TT)rc   TFFF)r   T)FN)r   )r   ignorer6   r   )rU  importlib.metadatar   _versionr   _PackageNotFoundError__version__r  collectionsr   collections.abcr   r   r   r	   rq   	itertoolsr
   r   r  	functoolsr   r   r   r   r   rj  r  r  r0  ImportErrorr   __all__r  PRESERVE_WHITESPACE_BREAK_LONG_WORDS_BREAK_ON_HYPHENSr  r  r  r  r1  r$   r   r   r   r&   r.   r:   rL   rQ   rV   ra   ri   rm   ru   ry   r   r   LATEX_ESCAPE_RULESr   r   r  sortedr  r  r  compiler7  r8  _esc_csi_osc_st_ansi_escape_patVERBOSEr+  rz  r-  rv  r   r   r   r   r  r   r
  r  r  r  r!  r$  r&  r)  r  r4  r9  r*   rB  rM  rU  rZ  rX  ra  rm  rt  rv  r  r  r  r  r  r  r  r  r  r   r  r  r!  r   r(  r+  r6  rA  rE  rG  r"   rI  r  rk  r  r  r  rQ  r6   r   r   <module>r     s    
:&K  " + % 8 % 	 	    

$ F	/           % &:; Y 7
8D 	CA 
.-
3
n 	%%%%%'%%



   <N 5!&xkr3b)RdB/r3b)"dB'D"%%{3	x ["dB'D"%	x* KsCc*S#sC0S#sC0sCc*#sC(S#&	+x> ;ueUE2UE5%8UE5%8ueUE2%.ue,	?xR KueUE2UE5%8UE5%8ueUE2%.ue,	Sxf +ueUE2UE5%8UE5%8ueUE2%.ue,	gxz +ueUE2UE5%8UE5%8ueUE2%.ue,	{xN ;ueUE2UE5%8UE5%8ueUE2%.ue,	Oxb +ueUE2UE5%8UE5%8ueUE2%.ue,	cxv +sCc*.S#sC0sCc*#sC(S#&	wxJ {sCc*S#sC0sCc*#sC(S#&	Kx^ kueUE2UE5%8ueUE2%.ue,	_xr {ueUE2UE5%8ueUE2%.ue,	sxF [ueUE2UE5%8ueUE2%.ue,	GxZ [ueUE2UE5%8ueUE2%.ue,	[xn kueUE2UE5%8ueUE2%.ue,	oxB [ueUE2UE5%8ueUE2%.ue,	CxV ksCc*S#sC0#sC(S#&%	Wxj K(.#sC(S#&%	kx~ kS#sC0#sC(S#&	xR K$d+S#&	Sxf kRc2."c2&C$	gxz ksCc*S#sC0sCc*#sC(S#&	{xN KsCc*S#sC0sCc*#sC(S#&	Oxb 
;r3b)RdB/r3b)"dB'D"%	cxv <'	
 T2r2.T2r2.tRR(3S9137wxT .UC,d3	Uxh %0eT*	ix| K2+RR8.e<,dE:%	}xP	 +2+RR8.d;,dD9%	Q	xd	 [+YB30"b"=	e	xx	 +YB30"b"=*r2
R0	y	xL
 k3dC["b"55r2rB	M
x`
 {3tD12r2>2BB?	a
xt
 
;"dB'D"%	 {&%-'	 -/wB+-.u-%	]xv .--/0 
Wh F =	
 N , , = , , F h F h h  F!" 
5#$ hy&(__&_3 L ::m, M2 2 &|&|
rl	 
 	 
  6 		 6 		c#  $ jj)2::6JJ/66v>

K " #%::E$  
(DB1h  &/d:/($: 14 D
4  >A E
1h!*.4<~'.0(L&d "&&4n6 "&&)GT5"';7
0,	;

S 
OdVh** VrfR  z	G o_  K$  G  		s5   j j "j/ 	jj	j,+j,/j:9j: