Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pandas/io/formats/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pandas/io/formats/__pycache__/printing.cpython-312.pyc

�

MٜgF����dZddlmZddlmZmZmZddlZddlm	Z	m
Z
mZmZddl
mZddlmZddlmZdd	lmZeeeefeefZed
�Zed�Zdd�Zddd
�Z	d 							d!d�Z	d 							d"d�Z					d#													d$d�Z	d%					d&d�Zd'd�Zd(d)d�Z 				d*											d+d�Z!						d,d�Z"Gd�de#eef�Z$Gd�d�Z%Gd�de%�Z&d-d�Z'y).z
Printing tools.
�)�annotations)�Iterable�Mapping�SequenceN)�Any�Callable�TypeVar�Union)�east_asian_width)�
get_option)�is_sequence)�get_console_size�_KT�_VTc	��|jdt�}|jdt�}g}|ddD�cgc]}tt	||��|z��}}|jtt	t|d���tt	t|��}t
|�D]?\}	}
||
||	d��}d||	zg|t|
�z
z|z}|j|��At|�}djd	�|D��Scc}w)
a�
    Glues together two sets of strings using the amount of space requested.
    The idea is to prettify.

    ----------
    space : int
        number of spaces for padding
    lists : str
        list of str which being joined
    strlen : callable
        function used to calculate the length of each str. Needed for unicode
        handling.
    justfunc : callable
        function used to justify str. Needed for unicode handling.
    �strlen�justfuncN����left)�mode� �
c3�>K�|]}dj|����y�w)�N)�join)�.0�liness  �E/usr/local/lib/python3.12/site-packages/pandas/io/formats/printing.py�	<genexpr>zadjoin.<locals>.<genexpr><s����8���R�W�W�U�^��s�)	�pop�len�_adj_justify�max�map�append�	enumerate�zipr)
�space�lists�kwargsrr�newLists�x�lengths�maxLen�i�lst�nl�toJoins
             r�adjoinr3s��� �Z�Z��#�
&�F��z�z�*�l�3�H��H�49�#�2�J�?�J�q�s�3�v�q�>�"�U�*�J�G�?��N�N�3�s�3��b�	�*�+�,�
��S�%��
!�F��E�"���3�
�c�7�1�:�F�
3���W�Q�Z�� �F�S��X�$5�6�"�
<�������#��(�^�F��9�9�8��8�8�8��@s�Dc���|dk(r|D�cgc]}|j|���c}S|dk(r|D�cgc]}|j|���c}S|D�cgc]}|j|���c}Scc}wcc}wcc}w)zB
    Perform ljust, center, rjust against string or list-like
    r�center��ljustr5�rjust)�texts�max_lenrr,s    rr"r"?sx���v�~�*/�0�%�Q����� �%�0�0�	
��	�+0�1�5�a�����!�5�1�1�*/�0�%�Q����� �%�0�0��	1��1��0��A(�A-�
A2c��t|t�rd}nt|d�rdnd}|durt|�}n|xst	d�xst|�}t|�}t
t|t|���D�cgc]}tt|�|dzfd|i|����}}dj|�}	|t|�kr|	d	z
}	n#t|t�rt|�dk(r|	d
z
}	|j|	��Scc}w)z�
    internal. pprinter for iterables. you should probably use pprint_thing()
    rather than calling this directly.

    bounds length of printed sequence, depending on options
    z
{{{body}}}�__setitem__z[{body}]z({body})F�
max_seq_items��, �, ...�,)�body)
�
isinstance�set�hasattrr!r�iter�range�min�pprint_thing�nextr�tuple�format)
�seq�	_nest_lvlr>�kwds�fmt�nitems�sr/�rrCs
          r�_pprint_seqrUcs����#�s����#�C��7�j�Z������S����I�*�_�"=�I��S����S�	�A��s�6�3�s�8�,�-�	�-�A�	�T�!�W�i�!�m�Q�=�Q�D�Q�-��	��9�9�Q�<�D�
��C�������	�C��	�C��H��M������:�:�4�:� � ��	s�;"C9c���d}g}d}|durt|�}n|xstd�xst|�}t|j��d|D]G\}}	|j	|jt
||dzfd|i|��t
|	|dzfd|i|������I|t|�kr$|jdj|�d	z�
�S|jdj|��
�S)zy
    internal. pprinter for iterables. you should probably use pprint_thing()
    rather than calling this directly.
    z{{{things}}}z{key}: {val}Fr>Nr?)�key�valr@rA)�things)r!r�list�itemsr%rMrJr)
rNrOr>rPrQ�pairs�pfmtrR�k�vs
          r�_pprint_dictr`�s����C��E��D�����S����I�*�_�"=�I��S����S�Y�Y�[�!�'�6�*���1�
����K�K� ��I��M�W��W�RV�W� ��I��M�W��W�RV�W�
�
�	
�+���C����z�z����5�!1�G�!;�z�<�<��z�z����5�!1�z�2�2�c�T��|f					d�fd�
}t|d�rt|�St|t�r|t	d�krt||d|��}|St
|�r |t	d�krt|||||��}|St|t�r|rd||��d�}|S||�}|S)	a
    This function is the sanctioned way of converting objects
    to a string representation and properly handles nested sequences.

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

    Returns
    -------
    str
    c����dddd�}t|t�r0�r|j|�n|}t|j	��}n|xsd}t|�}|D]}|j
|||�}�|S)Nz\tz\nz\r)�	r�
�)rD�dict�updaterZ�keys�str�replace)�thing�escape_chars�	translate�result�c�default_escapess     �r�as_escaped_stringz'pprint_thing.<locals>.as_escaped_string�sz���!��U�;�	��l�D�)��� � ��.�(�	��� 1� 1� 3�4�L�'�-�2�L��U����A��^�^�A�y��|�4�F���
ra�__next__zdisplay.pprint_nest_depthT)�
quote_stringsr>�rmrtr>�')rlrrm�EscapeChars | None�returnrj)rFrjrDrgrr`r
rU)rlrOrmrqrtr>rrros   `    rrJrJ�s����@8D����"4��	��$�u�j�!��5�z��	�E�4�	 �Y��#�2�&���9�D�
�
�� �M�
�U�	�	�J�7R�,S� S����%�'�'�
���M�
�E�3�	�M��&�u�-�.�a�0���M�#�5�)���Mrac�<�t|�}|j||�S�N)rJ�encode)�object�encoding�errors�values    r�pprint_thing_encodedr��s��
�� �E��<�<��&�)�)rac���dtjvryddlm}|�}|�y|jj
}d}|r2||vr#ddlm}ddlm	�G�fd�d|�}|�||<d	||_
y||vrd
||_
yy)N�IPythonr)�get_ipythonz!application/vnd.dataresource+json)�
BaseFormatter��
ObjectNamec�&��eZdZW�d�ZefZy)�<enable_data_resource_formatter.<locals>.TableSchemaFormatter�_repr_data_resource_N)�__name__�
__module__�__qualname__�print_methodrg�_return_typer�s�r�TableSchemaFormatterr�	s���)�*@�A�� $�w�rar�TF)�sys�modulesr�r��display_formatter�
formatters�IPython.core.formattersr��	traitletsr��enabled)�enabler��ipr��mimetyper�r�r�s       @r�enable_data_resource_formatterr��s��������#��#�	��B�	�z���%�%�0�0�J�2�H�
��:�%�=�,�
'�}�
'�
$8�#9�J�x� �'+�
�8��$�	�Z�	�',�
�8��$�
 rac� �t|dd|��S)N)rdrerTru�rJ)rlr>s  r�default_pprintr�s���
�'��#�	�rac�H�"�t�\}}|�td�xsd}|�t|�j}|r"t	|�}dd|dzz��}	dd|dzz��}
nd}	d}
t	|�}|rd	dt	|�zz}nd
}td�xs|}
||
kD}t��"												d�"fd�}d�"fd
�}d}|dk(rd|��}|S|dk(r|s||d�}d|�d|��}|S|dk(r%|s#||d�}||d�}d|�d|�d|��}|S|
dk(rg}|ddD�cgc]
}||���}}n]||
kDrAt
|
dzd�}|d|D�cgc]
}||���}}||dD�cgc]
}||���}}ng}|D�cgc]
}||���}}|r�|rt||�\}}n�|s:t	dj|��|krt	dj|��|ksTt||�||��}|D�cgc]}|j|���}}|D�cgc]}|j|���}}|r�|t	|
�z
}|d}d}ttdt	|�dz��D]!}t||��}t	|�|ks�|}n|D�cgc]}t||����}}|D�cgc]}t||����}}d}|
}|D]}||zdz} |||| ||
�\}}�|r||j�|
zdzz
}|
}|ddD]}!|!|zdz} |||| ||
�\}}�||||d|dz
|
�\}}||z
}d|jd�z}||z
}t	|�|kDs|r||	z
}n|dz
}d|t	|
�dz}|Scc}wcc}wcc}wcc}wcc}wcc}wcc}wcc}w)a�
    Return the formatted obj as a unicode string

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

    Returns
    -------
    summary string
    Nz
display.width�Prrr?�z
 z,
 rBzdisplay.max_seq_itemsc�����j|j���j|j��z|k\r||j�z
}|}||z
}||fSrz)r!�rstrip)rS�liner�
display_width�next_line_prefix�adjs     �r�_extend_linez+format_object_summary.<locals>._extend_line]sW����7�7�4�;�;�=�!�C�G�G�E�L�L�N�$;�;�}�L�
������A�#�D���
���$�w�rac�2��|rt�fd�|D��Sy)Nc3�@�K�|]}�j|����y�wrz�r!)rr,r�s  �rrz:format_object_summary.<locals>.best_len.<locals>.<genexpr>hs�����2�6�a�s�w�w�q�z�6�s�r)r#)�valuesr�s �r�best_lenz'format_object_summary.<locals>.best_lenfs�����2�6�2�2�2�rar@rz[]�[�]r�
)r>rz...)rSrjr�rjrrjr��intr�rjrxztuple[str, str])r��	list[str]rxr�)rr�typer�r!�get_adjustmentrI�_justifyrr#r8�reversedrHrUr�)#�obj�	formatter�
is_justify�name�indent_for_name�line_break_each_valuer��_�name_len�space1�space2�n�sepr>�is_truncatedr�r��close�summary�first�last�headr,�tail�
max_length�	max_spacer�	max_items�	num_items�pprinted_seqr��
head_value�word�	tail_itemr�s#                                  @r�format_object_summaryr�s����B(�)��M�1���"�?�3�9�r�
��|��C�y�!�!����t�9���s�h��l�+�-�.���s�h��l�+�-�.�������C��A���s�S��Y��&�����6�7�<�1�M��}�$�L��
�C������"%��69��MP��	���
�E��A�v��u�g�,��p�N�o
�a��-��#�a�&�!���e�W�A�e�W�%��j�N�i
�a��-��#�a�&�!����R��!���e�W�B�t�f�A�e�W�-��b�N�_�A���D�*-�b�c�(�3�(�Q�I�a�L�(�D�3�
��
��M�Q�&��+�A�*-�b�q�'�2�'�Q�I�a�L�'�D�2�*-�q�b�c�(�3�(�Q�I�a�L�(�D�3��D�*-�.�#�Q�I�a�L�#�D�.��$�&�d�D�1�
��d���D�I�I�d�O�$�}�4���	�	�$��(�=�8�!��$���$��@�
�59�:�T�����
�+�T��:�59�:�T�����
�+�T��:�!�
&��F��3�I���G�E��I�%�e�A�s�5�z�A�~�&>�?�	�*�5�	�J���|�$�y�0� )�I��	@�
FJ�J�T��K���;�T�D�J�EI�J�T��K���;�T�D�J������J���#�c�)�D�(��$��m�V�T�M�G�T����t�{�{�}�v�-��5�5�G��D��c�r��I��s�?�S�(�D�(��$��m�V�T�M�G�T�#�
%�W�d�D��H�m�a�>O�QW�X�
����4����e�l�l�3�'�'���5����w�<�=�)�-B��v��G��s�N�G����F��
�.�.���N��Y4��3��3��/��;��:��"K��Js0�M<�N�N�6N�3N�N�N�%Nc
��||z}dgt|d�z}|D]B}|D�cgc]
}t|���}}t||�D��cgc]\}}t||���}}}�D|D�	cgc]}	td�t|	|�D���� }
}	|D�	cgc]}	td�t|	|�D���� }}	|
|fScc}wcc}}wcc}	wcc}	w)a�
    Justify items in head and tail, so they are right-aligned when stacked.

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

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

    Examples
    --------
    >>> _justify([['a', 'b']], [['abc', 'abcd']])
    ([('  a', '   b')], [('abc', 'abcd')])
    rc3�DK�|]\}}|j|����y�wrz�r8�rr,r:s   rrz_justify.<locals>.<genexpr>�� ����
F�1E�:�1�g�a�g�g�g��1E��� c3�DK�|]\}}|j|����y�wrzr�r�s   rrz_justify.<locals>.<genexpr>�r�r�)r!r'r#rL)r�r��combinedr��	inner_seq�item�lengthr,�yrN�head_tuples�tail_tupless            rr�r��s���,�d�{�H���s�8�A�;�'�'�J��	�(1�2�	��#�d�)�	��2�,/�
�F�,C�D�,C�D�A�q�c�!�Q�i�,C�
�D��SW��RV�3��
F��S�*�1E�
F�F�RV���SW��RV�3��
F��S�*�1E�
F�F�RV�����#�#��3��D����s�B5�B:�##C�#Cc��eZdZdZdd�Zy)�
PrettyDictz.Dict extension to support abbreviated __repr__c��t|�Srzr���selfs r�__repr__zPrettyDict.__repr__�s
���D�!�!raN)rxrj)r�r�r��__doc__r�rfrarr�r��s
��8�"rar�c�.�eZdZdd�Zdd�Zdd	d�Zd
d�Zy)�_TextAdjustmentc�$�td�|_y)Nzdisplay.encoding)rr}r�s r�__init__z_TextAdjustment.__init__�s��"�#5�6��
rac��t|�Srzr��r��texts  rr!z_TextAdjustment.len�s���4�y�rac���|dk(r|D�cgc]}|j|���c}S|dk(r|D�cgc]}|j|���c}S|D�cgc]}|j|���c}Scc}wcc}wcc}w)zJ
        Perform ljust, center, rjust against string or list-like
        rr5r6)r�r9r:rr,s     r�justifyz_TextAdjustment.justifysx���6�>�.3�4�e��A�G�G�G�$�e�4�4�
�X�
�/4�5�u�!�A�H�H�W�%�u�5�5�.3�4�e��A�G�G�G�$�e�4�4��	5��5��4r;c�N�t|g|��|j|jd�|��S)N)rr)r3r!r�)r�r(r)r*s    rr3z_TextAdjustment.adjoins&���e�V�e�V�D�H�H�t�|�|�V�v�V�VraN�rx�None�r�rjrxr���right)r9rr:r�rrjrxr�)r(r�rxrj)r�r�r�r�r!r�r3rfrarr�r��s��7��	5�Wrar�c�B��eZdZd�fd�Zdd�Z	d							dd�Z�xZS)�_EastAsianTextAdjustmentc�p��t�|��td�rd|_nd|_dddddd�|_y)Nz!display.unicode.ambiguous_as_wider�r?)�Na�N�W�F�H)�superr�r�ambiguous_width�_EAW_MAP)r��	__class__s �rr�z!_EastAsianTextAdjustment.__init__s;���
�����9�:�#$�D� �#$�D� �
 !�q�q�q�q�A��
rac�b��t|t�st|�St�fd�|D��S)zN
        Calculate display width considering unicode East Asian Width
        c3�|�K�|]3}�jjt|��j����5y�wrz)r�getrr�)rrpr�s  �rrz/_EastAsianTextAdjustment.len.<locals>.<genexpr>$s3�����
�RV�Q�D�M�M���.�q�1�4�3G�3G�H�RV�s�9<)rDrjr!�sumr�s` rr!z_EastAsianTextAdjustment.lens3����$��$��t�9���
�RV�
�
�	
rac�"�����fd�}|dk(r%|D�cgc]}|j||����c}S|dk(r%|D�cgc]}|j||����c}S|D�cgc]}|j||����c}Scc}wcc}wcc}w)Nc�D����j|�z
t|�zSrzr�)�tr:r�s ��r�_get_padz2_EastAsianTextAdjustment.justify.<locals>._get_pad,s����T�X�X�a�[�(�3�q�6�1�1rarr5r6)r�r9r:rr	r,s` `   rr�z _EastAsianTextAdjustment.justify(s����	2��6�>�27�8�%�Q�A�G�G�H�Q�K�(�%�8�8�
�X�
�38�9�5�a�A�H�H�X�a�[�)�5�9�9�27�8�%�Q�A�G�G�H�Q�K�(�%�8�8��	9��9��8s�B�B�!Br�r�r��r9z
Iterable[str]r:r�rrjrxr�)r�r�r�r�r!r��
__classcell__)rs@rr�r�s9���
B�	
�?F�9�"�9�-0�9�8;�9�	�9rar�c�D�td�}|r
t�St�S)Nz display.unicode.east_asian_width)rr�r�)�use_east_asian_widths rr�r�7s#��%�&H�I���'�)�)�� � ra)r(r�r)r�rxrjr�r
)rN)rNrrOr�r>�
int | Nonerxrj)rNrrOr�r>rrxrj)rNFFN)rlrrOr�rmrwrq�boolrtrr>rrxrj)zutf-8rk)r}rjr~rjrx�bytes)r�rrxr�rz)rlrr>rrxrj)TNTF)r�rr�rr�z
str | Noner�rr�rrxrj)r��list[Sequence[str]]r�rrxz3tuple[list[tuple[str, ...]], list[tuple[str, ...]]])rxr�)(r��
__future__r�collections.abcrrrr��typingrrr	r
�unicodedatar�pandas._configr�pandas.core.dtypes.inferencer
�pandas.io.formats.consolerrj�EscapeCharsrrr3r"rUr`rJr�r�r�r�r�rgr�r�r�r�rfrar�<module>rs����#���
���)�%�4�6��G�C��H�%�x��}�4�5��
�e�n��
�e�n��9�@	1�JDH� !�	� !�!� !�6@� !�� !�HCG�3�	�3� �3�5?�3��3�B�'+�!�� $�
F��F��F�%�F��	F�
�F��
F�	�F�T4=�*��*�-0�*�
�*�-�B��� �"'�
h��h��h��	h�
�h� �
h�	�h�V&$�
�&$�%8�&$�8�&$�R"��c�3�h��"�W�W�,$9��$9�N!ra

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists