Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
table.cpython-313.pyc321 linesDownload Raw Back to __pycache__
1�

2�ja��	�(�SSKJrJrJr SSKJrJrJrJrJ	r	J3r4JrJrJ
r
 SSKJrJr SSKJrJr SSKJr SSKJrJr SSKJr SS	KJr SS5KJr SSKJ r J!r! SSK"J#r# SS
K$J%r% SSK&J'r'J(r( SSK)J*r*J+r+ \(aSSK,J-r-J.r.J/r/J0r0J1r1J2r2 \"SS55r3\"SS55r4"SS\	5r5"SS\5r6\7S:XGa�SSK8J-r- SSK9J:r: SSK;J<r< \<"S5 \6"SSS S!9r=\=R}S"S#S$S%S&9 \=R}S'S(S)9 \=R}S*S S+S,9 \=RS-S.S/5 \=RS0S1S25 \=RS3S4S5S6S%S79 \=RS8S9S:5 S;\@S<S=4S>jrA\-"5r,\:"5rB\A"S?5 \,R�\=S@SA9 S%\=lD\A"SB5 \,R�\=5 SC\=lE\A"SD5 \,R�\=S@SA9 S=\=lESE\=lDSFSG/\=lF\A"SH5 \,R�\=S@SA9 S=\=lESE\=lDSFSG/\=lFS\=lG\A"SI5 \,R�\=S@SA9 S=\=lESE\=lDSFSG/\=lFS%\=lHS\=lG\A"SJ5 \,R�\=S@SA9 S=S=S=5 g=g=!,(df   g==f)K�)�	dataclass�field�replace)	�
TYPE_CHECKING�Dict�Iterable�List�6NamedTuple�Optional�Sequence�Tuple�Union�)�box�errors)�loop_first_last�	loop_last)�	pick_bool)�ratio_distribute�ratio_reduce)�VerticalAlignMethod)�JupyterMixin)�Measurement)�Padding�PaddingDimensions)�
is_renderable)�Segment)�Style�	StyleType)�Text�TextType)�Console�ConsoleOptions�
JustifyMethod�OverflowMethod�RenderableType�RenderResultc�~�\rSrSr%SrSrS\S'SrS\S'Sr\	\S'Sr7\	\S'Sr\	\S	'S8rS\S'S
r
S\S'SrS\S'Sr\\\S'Sr\\\S'Sr\\\S'Sr\\\S'Sr\\S'Sr\\S'Sr\\S'\"\S9r\S\S'S$S jr\S\S4S!j5r \S\4S"j5r!S#r"g)%�Column�&a�	Defines a column within a ~Table.9 10Args:11    title (Union[str, Text], optional): The title of the table rendered at the top. Defaults to None.12    caption (Union[str, Text], optional): The table caption rendered below. Defaults to None.13    width (int, optional): The width in characters of the table, or ``None`` to automatically fit. Defaults to None.14    min_width (Optional[int], optional): The minimum width of the table, or ``None`` for no minimum. Defaults to None.15    box (box.Box, optional): One of the constants in box.py used to draw the edges (see :ref:`appendix_box`), or ``None`` for no box lines. Defaults to box.HEAVY_HEAD.16    safe_box (Optional[bool], optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True.17    padding (PaddingDimensions, optional): Padding for cells (top, right, bottom, left). Defaults to (0, 1).18    collapse_padding (bool, optional): Enable collapsing of padding around cells. Defaults to False.19    pad_edge (bool, optional): Enable padding of edge cells. Defaults to True.20    show_header (bool, optional): Show a header row. Defaults to True.21    show_footer (bool, optional): Show a footer row. Defaults to False.22    show_edge (bool, optional): Draw a box around the outside of the table. Defaults to True.23    show_lines (bool, optional): Draw lines between every row. Defaults to False.24    leading (int, optional): Number of blank lines between rows (precludes ``show_lines``). Defaults to 0.25    style (Union[str, Style], optional): Default style for the table. Defaults to "none".26    row_styles (List[Union, str], optional): Optional list of row styles, if more than one style is given then the styles will alternate. Defaults to None.27    header_style (Union[str, Style], optional): Style of the header. Defaults to "table.header".28    footer_style (Union[str, Style], optional): Style of the footer. Defaults to "table.footer".29    border_style (Union[str, Style], optional): Style of the border. Defaults to None.30    title_style (Union[str, Style], optional): Style of the title. Defaults to None.31    caption_style (Union[str, Style], optional): Style of the caption. Defaults to None.32    title_justify (str, optional): Justify method for title. Defaults to "center".33    caption_justify (str, optional): Justify method for caption. Defaults to "center".34    highlight (bool, optional): Highlight cell contents (if str). Defaults to False.35�r&�header�footer�header_style�footer_style�style�leftr$�justify�topr�vertical�ellipsisr%�overflowN�width�	min_width�	max_width�ratioF�no_wrap�	highlightr�_index)�default_factory�_cells�returnc��[U/S9$)zReturn a copy of this Column.�r?)r��selfs �PD:\code\apps\devtools\python\user_packages\Python313\site-packages\rich/table.py�copy�Column.copyts���t�B�'�'�c#�8# �URShv�N gN7f)z2Get all cells in the column, not including header.NrBrCs rE�cells�Column.cellsxs����;�;���s���c��URSL$)z!Check if this column is flexible.N)r:rCs rE�flexible�Column.flexible}s���z�z��%�%rH�)r@r))#�__name__�36__module__�__qualname__�__firstlineno__�__doc__r,�__annotations__r-r.rr/r0r2r4r6r7r�intr8r9r:r;�boolr<r=r�listr?r	rF�propertyrrJrM�__static_attributes__rOrHrEr)r)&s5���: "�F��!�H�!�F��!�H� �L�)� �-� �L�)� �-��E�9��-�%�G�_�%�[�&+�H�#�+�M�!+�H��+���E�8�C�=��\�#�I�x��}�#�_�#�I�x��}�#�_��E�8�C�=��w��G�T��R��I�t��C��F�C�O��%*�4�%@�F�D�!�"�@�(���x� 0�1�����&�$�&��&rHr)c�>�\rSrSr%SrSr\\\S'Sr	\37\S'Srg)�Row�zInformation regarding a row.Nr0F�end_sectionrO)rPrQrRrSrTr0rrrUr^rWrZrOrHrEr\r\�s$��&�!%�E�8�I��%� ��K���LrHr\c�<�\rSrSr%Sr\\S'S\S'\\S'Srg)	�_Cell�zA single cell in a table.r0r&�38renderabler4rON)	rPrQrRrSrTrrUrrZrOrHrEr`r`�s ��#���!� � ��!�!�"rHr`c7�P�\rSrSr%Sr\\\S'\\\S'SSSS\	RSSSSSSSSSS	S39SSSSSSS
S
SS.S\\\4S\
\S\
\S\
\S\
\S\
\	R S\
\S\S\S\S\S\S\S\S\S\S\S \
\\S!\
\S"\
\S#\
\S$\
\S%\
\S&S'S(S'S)\S*S46S+jjr\S	SSSS,.S\\\4S\S\S\S\S*S4S-jj5r\S*\4S.j5r\R4S\S*S4S/j5r\S*\4S0j5r\S*\4S1j5rS2S3S4\S*\4S5jrS2S3S6S7S*\4S8jr\S*\ \\\\44S9j5r!\!R4S\S*S4S:j5r!S]SSSSS;S<S=SSSSSS>.S?S@SAS@S!\
\S)\
\S"\
\S\
\SBS'SCSDSESFS\
\S\
\SG\
\SH\
\SI\S*S4SJjjjr"SSSK.SL\
S@S\
\SM\S*S4SNjjr#S^SOjr$S_SQjr%S2S3S6S7S*\\4SRjr&\SS\\ST\\SG\S*\\4SUj5r'S2S3SV\SW\S*\\(4SXjr)SV\S*\4SYjr*S2S3S6S7SW\S*\4SZjr+S2S3S6S7SS\\S*SP4S[jr,S\r-g)`�Table�a�40A console renderable to draw a table.41 42Args:43    *headers (Union[Column, str]): Column headers, either as a string, or :class:`~rich.table.Column` instance.44    title (Union[str, Text], optional): The title of the table rendered at the top. Defaults to None.45    caption (Union[str, Text], optional): The table caption rendered below. Defaults to None.46    width (int, optional): The width in characters of the table, or ``None`` to automatically fit. Defaults to None.47    min_width (Optional[int], optional): The minimum width of the table, or ``None`` for no minimum. Defaults to None.48    box (box.Box, optional): One of the constants in box.py used to draw the edges (see :ref:`appendix_box`), or ``None`` for no box lines. Defaults to box.HEAVY_HEAD.49    safe_box (Optional[bool], optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True.50    padding (PaddingDimensions, optional): Padding for cells (top, right, bottom, left). Defaults to (0, 1).51    collapse_padding (bool, optional): Enable collapsing of padding around cells. Defaults to False.52    pad_edge (bool, optional): Enable padding of edge cells. Defaults to True.53    expand (bool, optional): Expand the table to fit the available space if ``True``, otherwise the table width will be auto-calculated. Defaults to False.54    show_header (bool, optional): Show a header row. Defaults to True.55    show_footer (bool, optional): Show a footer row. Defaults to False.56    show_edge (bool, optional): Draw a box around the outside of the table. Defaults to True.57    show_lines (bool, optional): Draw lines between every row. Defaults to False.58    leading (int, optional): Number of blank lines between rows (precludes ``show_lines``). Defaults to 0.59    style (Union[str, Style], optional): Default style for the table. Defaults to "none".60    row_styles (List[Union, str], optional): Optional list of row styles, if more than one style is given then the styles will alternate. Defaults to None.61    header_style (Union[str, Style], optional): Style of the header. Defaults to "table.header".62    footer_style (Union[str, Style], optional): Style of the footer. Defaults to "table.footer".63    border_style (Union[str, Style], optional): Style of the border. Defaults to None.64    title_style (Union[str, Style], optional): Style of the title. Defaults to None.65    caption_style (Union[str, Style], optional): Style of the caption. Defaults to None.66    title_justify (str, optional): Justify method for title. Defaults to "center".67    caption_justify (str, optional): Justify method for caption. Defaults to "center".68    highlight (bool, optional): Highlight cell contents (if str). Defaults to False.69�columns�rowsN)rrFTr�noneztable.headerztable.footer�center)�title�captionr7r8r�safe_box�padding�collapse_padding�pad_edge�expand�show_header�show_footer�	show_edge�70show_lines�leadingr0�71row_stylesr.r/�border_style�title_style�
caption_style�
title_justify�caption_justifyr<�headersrjrkr7r8rrlrmrnrorprqrrrsrtrur0rvr.r/rwrxryrzr$r{r<r@c��/Ul/UlXlX lX0lX@lXPlX`l[R"U5Ul72X�lX�lX�l
X�lX�lX�lX�lX�lUUlU=(d SUlU=(d SUlUUlUUlUUlUUlUUlUUl=(d /5UlURR<nUHKn[?U[@5(aURCUS9 M)[EUR5Ul#U"U5 MM g)Nr+)r,)$rfrgrjrkr7r8rrlr�unpack�_paddingro�_expandrqrrrsrtrurnr0r.r/rwrxryrzr{r<rXrv�append�73isinstance�str�74add_column�lenr=)rDrjrkr7r8rrlrmrnrorprqrrrsrtrur0rvr.r/rwrxryrzr{r<r|�
append_columnr,s                             rE�__init__�Table.__init__�s��:&(���!��	��75����76�"���� �
����w�/��
� �
���&��&��"��$���� 0����77�(�.�B���(�.�B���(���&���*���.;���0?���"���/3�J�4D�"�/E������+�+�
��F��&�#�&�&����v��.� #�D�L�L� 1��
��f�%�rH)rmrnrorpc� �U"USUUSSSUUS.6$)ayGet a table with no lines, headers, or footer.78 79Args:80    *headers (Union[Column, str]): Column headers, either as a string, or :class:`~rich.table.Column` instance.81    padding (PaddingDimensions, optional): Get padding around cells. Defaults to 0.82    collapse_padding (bool, optional): Enable collapsing of padding around cells. Defaults to True.83    pad_edge (bool, optional): Enable padding around edges of table. Defaults to False.84    expand (bool, optional): Expand the table to fit the available space if ``True``, otherwise the table width will be auto-calculated. Defaults to False.85 86Returns:87    Table: A table instance.88NF)rrmrnrqrrrsrorprO)�clsrmrnrorpr|s      rE�grid�89Table.grid�s,��*�
���-������9091�92	93rHc�D�UR=(d URSL$)z-Setting a non-None self.width implies expand.N)r�r7rCs rErp�Table.expands���|�|�5�t�z�z��5�5rHc��Xlg)zSet expand.N)r�)rDrps  rErpr�"s	���rHc��SnUR(aUR(aUS-
nUR(aU[UR5S-94-
nU$)z'Get extra width to add to cell content.r�r)rrsr�rf)rDr7s  rE�_extra_width�Table._extra_width'sC�����8�8�����Q�J�E��8�8��S����&��*�*�E��rHc�,�[UR5$)zGet the current number of rows.)r�rgrCs rE�	row_count�Table.row_count1s���4�9�9�~�rH�consoler"�indexc��[R"5nUR(a6X1RURU[	UR5-5-
nUR95URnUbX1RU5-
nU$)zGet the current row style.)r�nullrv�	get_styler�rgr0)rDr�r�r0�	row_styles     rE�
get_row_style�Table.get_row_style6sp���96�97����?�?��&�&�t���u�s�4�?�?�?S�7S�'T�U�U�E��I�I�e�$�*�*�	�� ��&�&�y�1�1�E��rH�optionsr#c	�:�URnURbURnUS:a[SS5$URn[	URXR
X4-98555nURnURVs/sHnU"XR
U5U5PM nn[	SU55U-nURc[	SU55U-OURn	[X�5n99U100RUR5n101U102$s snf)Nrc3�8# �UHoRv� M g7f�N)�minimum��.0�measurements  rE�	<genexpr>�)Table.__rich_measure__.<locals>.<genexpr>V����D�|��#�#�|���c3�8# �UHoRv� M g7fr�)�maximumr�s  rEr�r�Yr�r�)r9r7rr��sum�_calculate_column_widths�update_width�_measure_columnrf�clampr8)rDr�r�r9�extra_widthr��column�measurements�
minimum_width�
maximum_widthr�s           rE�__rich_measure__�Table.__rich_measure__@s!���%�%�	��:�:�!��103�104�I��q�=��q�!�$�$��'�'����)�)��-�-�i�.E�F�
�105�	�106�.�.���,�,�107�&��
�G�%9�%9�)�%D�f�M�&�	�108�109
�D�|�D�D�{�R�	�110�111�112�"�
�D�|�D�D�{�R����	�113"�-�?��!�'�'����7�����114s�	"Dc��UR$)zGet cell padding.)rrCs rErm�
Table.paddingas���}�}�rHc�<�[R"U5UlU$)zSet cell padding.)rr~r)rDrms  rErmr�fs�� ���w�/��
��rHr1r3r5)r.r<r/r0r2r4r6r7r8r9r:r;r,r&r-r2r4rr6r%r9r:r;c���[[UR5UUU=(d SUbUOURU=(d SU=(d SUUU	U115UUU
US9nURR	U5 g)a�Add a column to the table.116 117Args:118    header (RenderableType, optional): Text or renderable for the header.119        Defaults to "".120    footer (RenderableType, optional): Text or renderable for the footer.121        Defaults to "".122    header_style (Union[str, Style], optional): Style for the header, or None for default. Defaults to None.123    highlight (bool, optional): Whether to highlight the text. The default of None uses the value of the table (self) object.124    footer_style (Union[str, Style], optional): Style for the footer, or None for default. Defaults to None.125    style (Union[str, Style], optional): Style for the column cells, or None for default. Defaults to None.126    justify (JustifyMethod, optional): Alignment for cells. Defaults to "left".127    vertical (VerticalAlignMethod, optional): Vertical alignment, one of "top", "middle", or "bottom". Defaults to "top".128    overflow (OverflowMethod): Overflow method: "crop", "fold", "ellipsis". Defaults to "ellipsis".129    width (int, optional): Desired width of column in characters, or None to fit to contents. Defaults to None.130    min_width (Optional[int], optional): Minimum width of column, or ``None`` for no minimum. Defaults to None.131    max_width (Optional[int], optional): Maximum width of column, or ``None`` for no maximum. Defaults to None.132    ratio (int, optional): Flexible ratio for the column (requires ``Table.expand`` or ``Table.width``). Defaults to None.133    no_wrap (bool, optional): Set to ``True`` to disable wrapping of this column.134r+N)r=r,r-r.r<r/r0r2r4r6r7r8r9r:r;)r)r�rfr<r�)rDr,r-r.r<r/r0r2r4r6r7r8r9r:r;r�s                rEr��Table.add_columnlsr��N��t�|�|�$���%�+��#,�#8�i�d�n�n�%�+���+�2���������135��"	
�����F�#rH�r0r^�renderablesr^c��S[SSSS4Sjn[U5nURn[U5[U5:a/UQS/[U5[U5-136-Qn[	U5H�upxU[U5:XaT[XpR137S9n	URHn138U"U	[S55 M URRU	5 OXgn	UcU"U	S5 Mz[U5(a139U"X�5 M�[R"S	[U5RS14035e URR[XS95 g)a�Add a row of renderables.141 142Args:143    *renderables (None or renderable): Each cell in a row must be a renderable object (including str),144        or ``None`` for a blank cell.145    style (StyleType, optional): An optional style to apply to the entire row. Defaults to None.146    end_section (bool, optional): End a section and draw a line. Defaults to False.147 148Raises:149    errors.NotRenderableError: If you add something that can't be rendered.150r�rbr&r@Nc�:�URRU5 gr�)r?r�)r�rbs  rE�add_cell�Table.add_row.<locals>.add_cell�s���M�M� � ��,rH)r=r<r+zunable to render z1; a string or other renderable object is requiredr�)r)rXrfr��	enumerater<rgr r�rr�NotRenderableError�typerPr\)rDr0r^r�r��cell_renderablesrfr�rbr��_s           rE�add_row�
Table.add_row�s@��$	-�V�	-�1A�	-�d�	-�>B�+�=N���,�,���� �3�w�<�/� �!� ���3�w�<�#�.>�*?�?�@� ��"+�+;�!<��E���G��$��u���G�����A��V�T�"�X�.�#����#�#�F�+� ����!����$��z�*�*���,��/�/�'��Z�(8�(A�(A�'B�Bs�t���"=� 	
�	�	����5�B�CrHc�P�UR(aSURSlgg)z2Add a new section (draw a line after current row).T�����N)rgr^rCs rE�add_section�Table.add_section�s ���9�9�(,�D�I�I�b�M�%�rHr'c	#�^^# �UR(d[S5v� gURnURbURnURnURTUR
X4-15155n[U5U-nURX`RSS9mS
S[S[SSSS4UU4S	jjjnUR(aCU"UR[R"URS1525UR S9Shv�N UR#TTU5Shv�N UR$(aDU"UR$[R"UR&S5UR(S9Shv�N ggNuN\N1537f)N�154)r7r<�height�textr0r2r$r@r'c�>�[U[5(aTRXSS9OUnTRUTR	US9S9$)NF)r0r<�r2)r�)r�r��155render_str�render�update)r�r0r2�render_textr��render_optionss    ��rE�render_annotation�1Table.__rich_console__.<locals>.render_annotation�sZ���156�d�C�(�(��"�"�4��"�F��
�157�>�>��^�%:�%:�7�%:�%K�"��
rHztable.title)r0r2z
table.caption)ri)rfrr9r7r�r�r�r�r�r<r!rrjr�158pick_firstrxrz�_renderrkryr{)	rDr�r�r9r��widths�table_widthr�r�s	 `      @rE�__rich_console__�Table.__rich_console__�sr�����|�|��$�-����%�%�	��:�:�!��159�160�I��'�'���.�.��W�)�)�)�*A�B�161���&�k�K�/�� �������(�162��163JR�164	��165	�#,�166	�7F�167	�
�168	�169	��:�:�(��170�171��&�&�t�'7�'7��G��*�*��
�
�172�<�<����@�@�@��<�<�(�����&�&�t�'9�'9�?�K��,�,��
�
��

�173	A�
�s7�DF�F�F�&F�'AF�:F�;F�F�Fc174���URnURnUVs/sHoPRXU5PM nnUVs/sHowR=(d SPM nnURn	UR175n176UR(Ga/UVs/sH*o�R(dMUR=(d SPM, nn[U5(a�[Xd5VVs/sH$upuUR(aSOURPM& n
nnUVs/sH>nUR(dMUR=(d SU	"UR5-PM@ nnU[U
5-177n[X�U5n[U5n[!U5H-unnUR(dMU
U[#U5-UU'M/ [U5nUU:�a�UR%UUVs/sH(oURSL=(a UR&(+PM* snU5n[U5nUU:�a*UU-178n[)US/[+U5-X�5n[U5n[X�5VVs/sH'unnURXR-U5U5PM) nnnUVs/sHowR=(d SPM nnUU:aUR(d UR.bnUUR.U179-180:a[UR.cUO[1UR.U181-182U5n[UU-183U5n[UU5VVs/sHunnUU-PM
 nnnU$s snfs snfs snfs snnfs snfs snfs snnfs snfs snnf)zNCalculate the widths of each column, including padding, not including borders.rrN)r9rfr�r��_get_padding_widthr�rprMr:�any�zipr7r=r�r�iterr��next�_collapse_widthsr;rr�r�r8�min)rDr�r�r9rfr��width_ranges�_ranger��get_padding_widthr��col�ratios�fixed_widths�flex_minimum�flexible_width�flex_widths�iter_flex_widthsr�r��excess_widthr7�184_max_width�185pad_widths�_width�pads                          rEr��Table._calculate_column_widthss;���%�%�	��,�,��IP�186�IP�v� � ��6�:��	�187�5A�A�L�&�.�.�%�A�%�L��A� �3�3���'�'���;�;�;�07�H���<�<�n�c�i�i�n�1�n��F�H��6�{�{�+.�l�*D� �*D��� ���A�f�n�n�<�*D�� �#*� �")�����K�V�\�\�&�Q�*;�F�M�M�*J�J�")�� �188"+�S��->�!>��.�~�|�T��#'��#4� �%.�w�%7�M�E�6�����(4�U�(;�d�CS�>T�(T��u�
�&8��&�k����"��*�*��MT�U�W�6�,�,�$�&�=�v�~�~�+=�=�W�U���F�189�f�+�K��Y�&�*�Y�6��%�l�Q�C�#�f�+�4E�v�V��!�&�k��&)��%9��%9�M�E�6��$�$�W�.B�.B�5�.I�6�R�%9�
��9E�E��f�n�n�)��)��F�E��)�#�����N�N�&�;�$�.�.�;�:V�+W��>�>�)������+�5�y�A�
�190*�*�{�*B�F�K�J�69�&�*�6M�N�6M�{�v�s�f�s�l�6M�F�N��
��s191��B��192I�� �� �� V����F��Os@�M�M�M�$M�+M�M�(,M�/M193�.M �
M&�*M+r��wrapablec��^�[U5nXC-194n[U5(a�U(a�US:�a�[S[X555m[U4Sj[X555nTU-195n[X5VV	s/sHup�UT:Xa	U	(aSOSPM n196nn	[U1975(aU(dU$[	XW5/[U5-n[
XZX�5n[U5nXC-198nU(aUS:�aM�U$s sn	nf)aReduce widths so that the total is under max_width.199 200Args:201    widths (List[int]): List of widths.202    wrapable (List[bool]): List of booleans that indicate if a column may shrink.203    max_width (int): Maximum width to reduce to.204 205Returns:206    List[int]: A new list of widths.207rc3�<# �UHupU(dMUv� M g7fr�rO)r�r7�208allow_wraps   rEr��)Table._collapse_widths.<locals>.<genexpr>^s���!�3H�/�e�J�E�E�3H�s�
�	c3�J># �UHupU(aUT:waUOSv� M g7f)rNrO)r�r7r��209max_columns   �rEr�r�as)����(�-B�)��(�E�Z�,?�E�Q�F�-B�s� #r)r�r��maxr�r�r�r)
r�r�r�r9�total_widthr��second_max_column�column_differencer7r�r��210max_reducers
            @rEr��Table._collapse_widthsLs����&�k��"�.���x�=�=��,��"2� �!�36�v�3H�!��211�%(�(�-0��-B�(�%�!�%/�1B�$B�!�.1��-B��-B�)��!�J�.�:�Q�A�E�-B����6�{�{�*;���
�"�,�B�C�c�&�k�Q�212�%�l�J�O��!�&�k��*�6��'�,��"2�(�
��s�:C8�column_indexr�c#�B^^^^^^# �URmURmURm[T5nUS:HmU[	UR2135S-214:Hm0mS[S[S[[[[[44UUUUUU4Sjjn/nURnURnUR(aAU"UR=(d S5U"UR5-n	U"X�R45 U"UR=(d S5n215URHnU"X�45 M UR (aAU"UR"=(d S5U"UR"5-nU"X�R$45 U(aY[&n
[)U5HCup�unn[+UU
"UU"X�55[-USS	5=(d UR.5v� ME g	UH3unn[+UU[-USS	5=(d UR.5v� M5 g	7f)216z3Get all the cells with padding and optional header.rr�	first_row�last_rowr@c�>�TRX45nU(aU$T
up4pVT	(a*T217(d[SXd-2185nU(d[SX5-2195nT(d$T220(aSnT(aSnU(aSnU(aSnX4XV4nUTX4'U$)Nr)�getr)r	r221�cachedr3�right�bottomr1r�_padding_cachern�first_column�last_columnrorms        ������rE�get_padding�%Table._get_cells.<locals>.get_padding�s����#�'�'��(=�>�F���
�'.�$�C���#��q�$�,�/�D�� ��C�L�1�F����D���E���C���F��F�1�H�4<�N�I�0�1��OrHr+r4N)rnrormr�r�rfrWr
rVr�r�rqr.r,r0rJrrr/r-rrr`�getattrr4)rDr�rr��any_paddingr�	raw_cells�_appendr�r.�222cell_style�cellr/�_Padding�first�lastr0rbrrnrrrorms                  @@@@@@rE�223_get_cells�Table._get_cellsss�����224 �0�0���=�=���,�,���'�l��#�q�(��"�c�$�,�,�&7�!�&;�;��MO��	�4�	�4�	�E�#�s�C�QT�BT�<U�	�	�2?A�	��"�"���%�%�	����$�T�%6�%6�%<�"�=�	��#�#�A��L�
�\�=�=�1�2��v�|�|�1�r�2�225��L�L�D��Z�&�'�!����$�T�%6�%6�%<�"�=�	��#�#�A��L�
�\�=�=�1�2���H�4C�I�4N�0��0�e�Z����Z��U�)A�B��J�226�D�9�L�V�_�_���5O�&/�!��z�����J�227�D�9�L�V�_�_���&/�s�HHc���URup#p$UR(aSn[XC-2285nUR(d&US:XaSnU[	UR2295S-230:XaSnXC-$)zGet extra width from padding.rr)rmrn�absror�rf)rDrr��	pad_right�pad_lefts     rEr��Table._get_padding_width�sc��$(�L�L�!��a�� � ��H��H�0�1�I��}�}��q� ����s�4�<�<�0�1�4�4��	��#�#rHc��URnUS:a[SS5$URUR5nURb5[URU-URU-5RU5$/n/nURnURn	[Rn231URXRU5H(nU232"XUR5up�U"U5 U	"U
5 M* [U(a[U5OSU(a[U5OU5RU5nURURcSOURU-URcS5nU$URU-5nU$)z0Get the minimum and maximum width of the column.rrN)
r9rr�r=r7�with_maximumr�rrrbrr�r8)rDr�r�r�r9�
padding_width�233min_widths�234max_widths�235append_min�236append_max�get_render_widthr�_min�_maxr�s               rEr��Table._measure_column�sj���%�%�	��q�=��q�!�$�$��/�/��
�
�>�
��<�<�#�����}�,�f�l�l�]�.J���l�9�%�
&�!#�237� "�238��&�&�239��&�&�240�&�?�?���O�O�G�]�]�F�C�D�)�'�D�O�O�L�J�D��t���t��D�241"�)�C�242�O�q�)�C�243�O�y�244��,�y�245!�	�"�'�'��$�$�,�D�&�2B�2B�]�2R��$�$�,�D�246����39�2B�2B�]�2R�247���rHc#�
^^^*^+^,^-# �TRTR=(d S5nUTRTR=(d S5-nUU4Sj[TR55n[[
U65nTR(a8TRRU[TRTR5S9OSnU(a!TR(dUR5OUn[R"5n	TRn248TRnTRnTR n
TR"nTR$n[m*U(a�T*"UR&U5T*"UR(U5T*"UR*U54T*"UR,U5T*"UR.U5T*"UR0U54T*"UR2U5T*"UR4U5T*"UR6U54/nU
(aT*"UR9U5U5v� U	v� O/nTR:nTRn[[=U55GH�ununnnU=(a Um,U=(a Um+T,(dT+(dTR>UU-249OSnSn/nT,(dT+(a[@RB"5nOU"U"TU(aUS-250OU55n[
UUU2515H�unnnUREUURFURHURJSURLS9nTROURPUU"UR5U-S9n[SU[UU55nURWU5 M� [SSU55m-S[X[X[S	S252S[ZS[@S
[X[X[4253U*U+U,U-4Sjjn [
UUUU2545VV!VVs/sHAunn!nnT*R]U "UU!R^UU"U!R5U-5UU5PMC snnn!nUSS&U(a�U(a%U(aT*"URaUSU
S9U5v� U	v� UU(aSO255U(aSOSun"n#n$U$RbRe5(aU$O)T*"U$RbURfU$R-5n%[iU5HLn&U
(aU"v� [kU5H un'n(U(U&Shv�N U'(aMU%v� M" U
(aU#v� U	v� MN O,[iU5Hn&UHn(U(U&Shv�N M U	v� M U(a,U(a%U(aT*"URaUSU
S9U5v� U	v� U=(a URln)U(dGMXU(dU(d256U)(dGMpU(aGMzU(aU[UU5S-257:�aGM�U(a258T,(aGM�U(aT*"URaUSU
S9U-U5v� OT*"URaUSU
S9U5v� U	v� GM� U(a'U
(aT*"URoU5U5v� U	v� gggs snnn!nfGNvGN47f)Nr+c3�L># �UHupTRTX5v� M g7fr�)r)r�rr�r�rDs   ��rEr�� Table._render.<locals>.<genexpr>�s)����259�(?�$��
�O�O�G�\�:�:�(?�s�!$)�safer)r7r2r;r6r�r<�r0c3�8# �UHn[U5v� M g7fr�)r�)r�rs  rEr�r2Ns���9�5�4�S��Y�Y�5�r�rr4rr7r0r@c�>�T(aSnO	T(aSnUS:XaTRXTU5$US:XaTRXTU5$TRXTU5$)Nrr3�middle)�	align_top�align_middle�align_bottom)rr4r7r0�_Segment�260footer_row�261header_row�262row_heights    ����rE�263align_cell�!Table._render.<locals>.align_cellPsd����'�H��$�H��u�$�#�-�-�d�:�u�M�M���)�#�0�0��j�%�P�P��,�,�T�*�e�L�LrH�foot)�edgerr��head�mid�row)8r�r0rwr�rfrXr�r�264substituterrlrq�get_plain_headed_boxr�linerrrsrtru�	head_left�265head_right�
head_vertical�mid_left�	mid_right�mid_vertical�	foot_left�266foot_right�
foot_vertical�get_topr�rrgrr�r�r2r;r6r<�render_linesrbrr�r�r	rV�	set_shaper4�get_rowr��strip�background_style�rangerr^�267get_bottom).rDr�r�r��table_stylerw�
_column_cells�	row_cells�_box�new_linerfrqrrrsrtru�box_segmentsr�r�r�rr�row_cellrE�268max_heightrJr�r7rr�r��linesr?�_cellr1r�_divider�divider�line_no�	last_cell�
rendered_cellr^r;r<r=r>s.``                                        @@@@rEr��
Table._render�s�����'�'��269�270�(8�b�9��"�W�%6�%6�t�7H�7H�7N�B�%O�O��271�(1�$�,�,�(?�272�
�273.2�#�}�2E�-F�	�274�x�x�
�H�H����i��
�
�w�7G�7G�H�
 �
��	
�/3�4�;K�;K�t�(�(�*�QU���<�<�>���,�,���&�&���&�&���N�N�	��_�_�275��,�,������T�^�^�\�:��T�_�_�l�;��T�/�/��>���T�]�]�L�9��T�^�^�\�:��T�.�.��=���T�^�^�\�:��T�_�_�l�;��T�/�/��>���L�"��t�|�|�F�3�\�B�B�����L��*�*�
��%�%�	�.7��	�8R�.S�*�E�*�E�4���.�;�J��-�+�J�#�:��	�	�%�+�-�.��
�276�J�/1�E��Z�!�J�J�L�	�%�!�'��5�1�9��O��	�(+�6�8�W�'E�#��t�V�!(����"�N�N�"�N�N�#�_�_��$�.�.�
"0�"�� �,�,��O�O�"�#�D�J�J�/�)�;�-���277!��S��Z�8�278����U�#�(F�"�9�5�9�9�J�
M��4��=�)�
M�/�
M��
M��	
M�279�d�7�m�$�
M�
M�836�f�h��w�2W��3X�.�E�5�$���"�"�������!�%�+�+�.��:�	���	�3X��E�!�H���K�"����V�V�)��D�l���#�N�(4�%�Q�4�a�UV�(X�%��e�X�280 �}�}�*�*�,�,��!� �
�
�y�'A�'A�H�N�N�'R��� %�Z�0�G� �"�281�4=�e�4D�0�	�=�#0��#9�9�9�(�y�")�M�5E�!�#��"�N� 1� %�Z�0�G�).�
�#0��#9�9�9�*/�"�N� 1���+���L�L���i�L�@�,������1�#�/�/�K��t��w�+�+���(�U�c�)�n�q�6H�-H�(�Z�Z��&� �L�L���Y�L�G�'�Q�(���282'� �L�L���Y�L�G����#�N�m/T�p�I��4�?�?�6�2�L�A�A��N��4��I�D:�:�sX�O+Z�3AY=�;CZ�Z283�	Z�7Z�Z284�AZ�7Z�Z�Z�5Z�BZ�Z)r�rrwrrkr{ryrnrfr/r.r<rur8rorvrgrlrsrrrqrtr0rjrzrxr7)r+r+)r@N)r�r"r�r#r@r').rPrQrRrSrTr	r)rUr\r�285HEAVY_HEADrr�rr!rV�BoxrWrrrr��classmethodr�rYrp�setterr�r�r�rr�r
rmr�r�r�r�r�r�r`rr�r�r�rZrOrHrErdrd�s����>�&�\��286�s�)�O�287%)�&*�#�#'�!$���#'�%+�!&��� �!�� ��!�48�,:�,:�,0�+/�-1�)1�+3��7>&�����$�>&���!�>&��(�#�	>&�288��}�>&��C�=�
>&��c�g�g�
�>&��4�.�>&�#�>&��>&��>&��>&��>&��>&��>&� �!>&�"�#>&�$�%>&�&�X�i�0�1�'>&�(�y�)�)>&�*�y�)�+>&�,�y�)�->&�.�i�(�/>&�0 �	�*�1>&�2'�3>&�4)�5>&�6�7>&�8289�9>&�@�&'�!%���
290�����$�291�#�292��	293�294�295��
296�297�298��299�@�6��6��6��]�]��T��d������c������3�����Y��s��y��� ��+;��	��B���s�C��c�1�2����
�^�^��0��W����$&�#%�8$�300-1�$(�,0�%)�#)�*/�%/�#�#'�#'�#��!8$� �8$�!�8$�301�y�)�8$��D�>�
8$��y�)�8$��	�"�8$�!�8$�(�8$�#�8$���}�8$��C�=�8$��C�=�8$���}�8$� �!8$�"302�#8$�z&*�!�	-D��/�0�-D��	�"�-D��	-D�303304�-D�^-�.� �.�+;�.�	�.�`?� �?�+;�?�	
�c��?�B�$��#�Y�$�*.�t�*�$�AD�$�	
�c��$��$�LG� �G�03�G�=C�G�	�%��G�R$�s�$�s�$� %��%�"�%��	%�305306�%�Nt� �t�+;�t�EI�#�Y�t�	�trHrd�__main__)r")�ReprHighlighter)�timerzTable renderzStar Wars MovieszRich example tabler)rjrkr{�Released�bright_cyan�cyanT)r.r0r;�Title�magentar4z307Box Office�green)r2r0zDec 20, 2019z Star Wars: The Rise of Skywalkerz$952,110,690zMay 25, 2018zSolo: A Star Wars Storyz$393,151,347zDec 15, 2017z!Star Wars Ep. V111: The Last Jediz$1,332,539,889zon blackr�zDec 16, 2016zRogue One: A Star Wars Storyz$1,332,439,889r�r@Nc��[R5 [R[U55 [R5 gr�)r��print�ruler<)r�s rEr,r,�s$���M�M�O��L�L��4��)��M�M�OrHz
Example Tablerir�zexpand=True�2zwidth=50F�dimrhzrow_styles=['dim', 'none']z%leading=1, row_styles=['dim', 'none']z+show_lines=True, row_styles=['dim', 'none'])I�dataclassesrrr�typingrrrr	r308rrr
rr+rr�_looprr�_pickr�_ratiorr�alignr�jupyterr�measurerrmrr�protocolr�segmentrr0rrr�r r!r�r"r#r$r%r&r'r)r\r`rdrP�rich.console�rich.highlighterro�_timerrp�tabler�r�r�r,r<rxrpr7rvrurtrOrHrE�<module>r�s���1�1�309�310�311��-��2�&�!� �/�#��#� �����Y&�Y&��Y&�x�M�M��M�#�J�#�N�L�N�b�z��$�0��	�~�	��$�(�#�312��	����]�&�$�	�	313�	����	��2�
����w�g��F�
�
�
��.��	314�315	�
�
�n�&?��P�
�
�
��/����	�	316�	�
�
��*��	317�	��	��	�318�)��#�%�	�����
�
�e�X�
�.�����}���
�
�e������z���
�
�e�X�
�.�������!�6�?����+�,��
�
�e�X�
�.�������!�6�?�����
��6�7��
�
�e�X�
�.�������!�6�?��������
��<�=��
�
�e�X�
�.�O319�	�
�320�	�s
�!FJ�321J
codekingpro/portable-devtools · Team Ai