Sindbad~EG File Manager

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

�

Mٜg���
�*�dZddlmZddlmZmZddlZddlmZddl	m
Z
mZmZddl
Z
ddlZddlZddlmZmZmZmZmZmZddlZddlZddlmZddlZddlZdd	lmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'dd
l(m)Z)m*Z+m,Z,m-Z-m.Z.ddl/Z/ddl0Z0ddl1m2Z2m3Z3ddl4m5Z5m6Z6dd
l7m8Z8ddl9m:Z:ddl;m<Z<ddl=m>Z>m?Z?m@Z@mAZAddlBmCZCddlDmEZEeFe.e,ze-z�ZGeGj�d�ej�d�ZJe%de2��ZKerddlLmMZMddl1mNZNmOZOmPZPmQZQmRZRmSZSddlTmUZUe
j�Gd�d��ZWe
j�Gd�de#e!��ZXdSd�ZYe'dTd ��ZZe'dUd!��ZZdVd"�ZZdWd#�Z[e'dXdYd%��Z\e'	dX					dZd&��Z\	d[					d\d(�Z\d)�Z]d]d*�Z^e:eEd+eEd,dz�-�				d^											d_d.��Z_d`d/�Z`d0d0d0d0d1d2d3d4d5d6�	ZaeFeaj���Zc				dad7�Zde:eEd,dz�8�						dbd9��Zedcd:�Zfe'd$d$d$d$d$d;�																	ddd=��Zge'd$d$d$d$d$d$d>�																	ded?��Zge'd$d$d$d$d$d$d>�																	dfd@��Zge:eEd,d<z�8�ddd'dAddd>�																	dgdB��ZgGdC�dDee�ZhGdE�dFeh�ZiGdG�dHeh�ZjGdI�dJ�ZkGdK�dL�Zl						dhdM�ZmdidN�ZndjdO�Zoej�dkdP��Zq	dl					dmdQ�Zr						dndR�Zsy)ozCommon IO api utilities�)�annotations)�ABC�abstractmethodN)�defaultdict)�Hashable�Mapping�Sequence)�BufferedIOBase�BytesIO�	RawIOBase�StringIO�
TextIOBase�
TextIOWrapper)�Path)
�IO�
TYPE_CHECKING�Any�AnyStr�DefaultDict�Generic�Literal�TypeVar�cast�overload)�urljoin�urlparse�uses_netloc�uses_params�
uses_relative)�
BaseBuffer�
ReadCsvBuffer)�get_bz2_file�
get_lzma_file)�import_optional_dependency)�doc)�find_stack_level)�is_bool�is_file_like�
is_integer�is_list_like)�
ABCMultiIndex)�_shared_docs�z^[A-Za-z][A-Za-z0-9+\-+.]*://�BaseBufferT)�bound)�
TracebackType)�CompressionDict�CompressionOptions�FilePath�
ReadBuffer�StorageOptions�WriteBuffer)�
MultiIndexc�H�eZdZUdZded<ded<ded<ded<d	Zd
ed<y)
�IOArgsz?
    Return value of io/common.py:_get_filepath_or_buffer.
    �str | BaseBuffer�filepath_or_buffer�str�encoding�moder1�compressionF�bool�should_closeN)�__name__�
__module__�__qualname__�__doc__�__annotations__rA���;/usr/local/lib/python3.12/site-packages/pandas/io/common.pyr9r9as)���)�(��M�

�I� � ��L�$�rHr9c��eZdZUdZded<ded<eje��Zded<d	Z	d
ed<dd�Z
dd
�Z								dd�Zy)�	IOHandlesau
    Return value of io/common.py:get_handle

    Can be used as a context manager.

    This is used to easily close created buffers and to handle corner cases when
    TextIOWrapper is inserted.

    handle: The file handle to be used.
    created_handles: All file handles that are created by get_handle
    is_wrapped: Whether a TextIOWrapper needs to be detached.
    z
IO[AnyStr]�handler1r?)�default_factoryzlist[IO[bytes] | IO[str]]�created_handlesFr@�
is_wrappedc�d�|jrut|jt�sJ�|jj	�|jj�|jj|j�|jD]}|j��g|_d|_y)z�
        Close all created buffers.

        Note: If a TextIOWrapper was inserted, it is flushed and detached to
        avoid closing the potentially user-created buffer.
        FN)	rO�
isinstancerLr�flush�detachrN�remove�close)�selfrLs  rIrUzIOHandles.close�s���?�?��d�k�k�=�9�9�9��K�K�����K�K��� �� � �'�'����4��*�*�F��L�L�N�+�!�����rHc��|S�NrG�rVs rI�	__enter__zIOHandles.__enter__�s���rHc�$�|j�yrX)rU)rV�exc_type�	exc_value�	tracebacks    rI�__exit__zIOHandles.__exit__�s
��	
�
�
�rHN��return�None)razIOHandles[AnyStr])r\ztype[BaseException] | Noner]zBaseException | Noner^zTracebackType | Nonerarb)
rBrCrDrErF�dataclasses�field�listrNrOrUrZr_rGrHrIrKrKnsm���
�� � �1B��1B�1B�SW�1X�O�.�X��J��� �"��,��(��(�	�

�rHrKc�Z�t|t�syt|�jtvS)z�
    Check to see if a URL has a valid protocol.

    Parameters
    ----------
    url : str or unicode

    Returns
    -------
    isurl : bool
        If `url` has a valid protocol return True otherwise False.
    F)rQr<�	parse_url�scheme�_VALID_URLS��urls rI�is_urlrl�s&���c�3����S�>� � �K�/�/rHr;c��yrXrG�r;s rI�_expand_userro����rHc��yrXrGrns rIroro�rprHc�d�t|t�rtjj	|�S|S)a]
    Return the argument with an initial component of ~ or ~user
    replaced by that user's home directory.

    Parameters
    ----------
    filepath_or_buffer : object to be converted if possible

    Returns
    -------
    expanded_filepath_or_buffer : an expanded filepath or the
                                  input if not expandable
    )rQr<�os�path�
expanduserrns rIroro�s+���$�c�*��w�w�!�!�"4�5�5��rHc�`�|�yt|�r!tt|�}|dkrtd��yt	|d��rRtt
|�}t
tt|��std��td�|D��rtd��yt|�rtd��td��)	NrzUPassing negative integer to header is invalid. For no header, use header=None insteadF)�
allow_setsz*header must be integer or list of integersc3�&K�|]	}|dk���y�w)rNrG)�.0�is  rI�	<genexpr>z&validate_header_arg.<locals>.<genexpr>�s����%�f��q�1�u�f�s�z8cannot specify multi-index header with negative integersz�Passing a bool to header is invalid. Use header=None for no header or header=int or list-like of ints to specify the row(s) making up the column names)r)r�int�
ValueErrorr*r	�all�map�anyr'�	TypeError)�headers rI�validate_header_argr��s���
�~���&���c�6�"���A�:��9��
�	��F�u�-��h��'���3�z�6�*�+��I�J�J��%�f�%�%��W�X�X���v���
4�
�	
��A�
B�BrH.c��yrXrG�r;�convert_file_likes  rI�stringify_pathr��rprHc��yrXrGr�s  rIr�r��s��rHFc��|st|�rtt|�St|tj
�r|j
�}t|�S)a�
    Attempt to convert a path-like object to a string.

    Parameters
    ----------
    filepath_or_buffer : object to be converted

    Returns
    -------
    str_filepath_or_buffer : maybe a string version of the object

    Notes
    -----
    Objects supporting the fspath protocol are coerced
    according to its __fspath__ method.

    Any other object is passed through unchanged, which includes bytes,
    strings, buffers, or anything else that's not even path-like.
    )r(rr.rQrs�PathLike�
__fspath__ror�s  rIr�r��sI��.��.@�!A��K�!3�4�4��$�b�k�k�2�/�:�:�<���*�+�+rHc�B�ddl}|jj|i|��S)z`
    Lazy-import wrapper for stdlib urlopen, as that imports a big chunk of
    the stdlib.
    rN)�urllib.request�request�urlopen)�args�kwargs�urllibs   rIr�r�s#��
�!�6�>�>�!�!�4�2�6�2�2rHc��t|t�xr2ttj	|��xr|jd�S)zR
    Returns true if the given URL looks like
    something fsspec can handle
    )zhttp://zhttps://)rQr<r@�_RFC_3986_PATTERN�match�
startswithrjs rI�
is_fsspec_urlr�$sA��	�3���	8��"�(�(��-�.�	8����6�7�7�rH�storage_options�compression_options)r�r�c�&�t|�}t|�\}}t||�}|r6t|d�r*d|vr&t	j
dtt���d}t||��}d|vr1|dvr-|d	vr)t	j
|�d
|��tt���|}d|vr	d|vr|dz
}t|t�r�t|�r�|xsi}ddl
}|jj||�
�}t!|�5}	|	j"j%dd�}
|
dk(rddi}t'|	j)��}ddd�t+||d|��St-|�r�t|t�sJ�|j/d�r|j1dd�}|j/d�r|j1dd�}t3d�}g}
	t3d�ddlm}m}||t:g}
	|j>|fd|i|xsi��j?�}t+|||d|��S|rtCd��t|ttDtFjFf�rt+tI|�||d|��St|d�s%t|d�sdtK|���}tC|��t+|||d|��S#1swY��kxYw#t<$rY��wxYw#tA|
�$rB|�ddi}nt|�}d|d<|j>|fd|i|xsi��j?�}Y��wxYw)a�
    If the filepath_or_buffer is a url, translate and return the buffer.
    Otherwise passthrough.

    Parameters
    ----------
    filepath_or_buffer : a url, filepath (str, py.path.local or pathlib.Path),
                         or buffer
    {compression_options}

        .. versionchanged:: 1.4.0 Zstandard support.

    encoding : the encoding to use to decode bytes, default is 'utf-8'
    mode : str, optional

    {storage_options}


    Returns the dataclass IOArgs.
    �write�bzDcompression has no effect when passing a non-binary object as input.)�
stacklevelN)�method�w)�bz2�xz)zutf-16zutf-32z( will not write the byte order mark for �tr)�headerszContent-Encoding�gzipr�T)r;r=r?rAr>zs3a://zs3://zs3n://�fsspec�botocore)�ClientError�NoCredentialsErrorr>�anonz?storage_options passed with file object or non-fsspec file pathF�readz)Invalid file path or buffer object type: )&r��get_compression_method�infer_compression�hasattr�warnings�warn�RuntimeWarningr&�dict�UnicodeWarningrQr<rlr�r��Requestr�r��getrr�r9r�r��replacer$�botocore.exceptionsr�r��PermissionError�ImportError�open�tupler}�bytes�mmapro�type)r;r=r?r>r��compression_method�fsspec_moder��req_info�req�content_encoding�readerr��err_types_to_retry_with_anonr�r��file_obj�msgs                  rI�_get_filepath_or_bufferr�0s���>(�(:�;��'=�[�&I�#���*�+=�?Q�R���g�&8�'�B�s�RV���
�
�R��'�)�	
�
"���{�+=�>�K�
	�t���-�/��,�,��
�
��m�C�H�:�N��'�)�	
��K�
�+��#�[�"8��s����$�c�*�v�6H�/I�*�/�R��	��>�>�)�)�*<�o�)�V��
�X�
�#�"�{�{���/A�4�H���6�)�'��0���S�X�X�Z�(�F���%��#���
�	
��'�(����
�	
�
��(�(��2�!3�!;�!;�H�g�!N���(�(��2�!3�!;�!;�H�g�!N��+�H�5��35�$�
	�&�z�2�
��"��,�(�	�"�v�{�{�"��)4��9H�9N�B���d�f�
��'��#���
�	
�
��M�
�	
��$�s�E�4�9�9�&=�>��+�,>�?��#���
�	
�	�"�F�+�w�7I�7�/S�9�$�?Q�:R�9S�T����o���-����
���u�
��T�	��	���1�2�		��&�#)�4�.��#'��"7��*.���'�"�v�{�{�"��)4��9H�9N�B���d�f�
�		�s1�<?J$�J1�!'K�$J.�1	J=�<J=�AL�Lc�2�ddlm}td||��S)z�
    converts an absolute native path to a FILE URL.

    Parameters
    ----------
    path : a path in native format

    Returns
    -------
    a valid FILE URL
    r)�pathname2urlzfile:)r�r�r)rtr�s  rI�file_path_to_urlr��s��,��7�L��.�/�/rH�tarr�r��zipr��zstd)	�.tar�.tar.gz�.tar.bz2�.tar.xz�.gz�.bz2�.zip�.xzz.zstc��t|t�r!t|�}	|jd�}||fSi}|}||fS#t$r}td�|�d}~wwxYw)a
    Simplifies a compression argument to a compression method string and
    a mapping containing additional arguments.

    Parameters
    ----------
    compression : str or mapping
        If string, specifies the compression method. If mapping, value at key
        'method' specifies compression method.

    Returns
    -------
    tuple of ({compression method}, Optional[str]
              {compression arguments}, Dict[str, Any])

    Raises
    ------
    ValueError on mapping missing 'method' key
    r�z.If mapping, compression must have key 'method'N)rQrr��pop�KeyErrorr})r?�compression_argsr��errs    rIr�r�s{��.�+�w�'���,��	X�!1�!5�!5�h�!?���/�/�/���(���/�/�/���	X��M�N�TW�W��	X�s�:�	A�A�A)r�c�0�|�y|dk(r^t|d��}t|t�sytj	�D](\}}|j�j
|�s�&|cSy|tvr|Sddgtt�z}d|�d|��}t|��)a/
    Get the compression method for filepath_or_buffer. If compression='infer',
    the inferred compression method is returned. Otherwise, the input
    compression method is returned unchanged, unless it's invalid, in which
    case an error is raised.

    Parameters
    ----------
    filepath_or_buffer : str or file handle
        File path or object.
    {compression_options}

        .. versionchanged:: 1.4.0 Zstandard support.

    Returns
    -------
    string or None

    Raises
    ------
    ValueError on invalid compression specified.
    N�inferT)r��Unrecognized compression type: z
Valid compression types are )
r�rQr<�extension_to_compression�items�lower�endswith�_supported_compressions�sortedr})r;r?�	extension�validr�s     rIr�r�&s���4����g��+�,>�RV�W���,�c�2��'?�&D�&D�&F�"�I�{�!�'�'�)�2�2�9�=�"�"�'G���-�-���
�d�O�f�%<�=�=�E�
)�+��7'�',�g�	/���S�/�rHc�l�t|�j}|j�std|�d���y)z�
    Check if parent directory of a file exists, raise OSError if it does not

    Parameters
    ----------
    path: Path or str
        Path to check parent directory of
    z1Cannot save file into a non-existent directory: '�'N)r�parent�is_dir�OSError)rtr�s  rI�check_parent_directoryr�]s7���$�Z�
�
�F��=�=�?��J�6�(�RS�T�U�U�rH)r=r?�
memory_map�errorsr��path_or_bufc��yrXrG�r�r>r=r?r��is_textr�r�s        rI�
get_handler�k���rH)r=r?r�r�r�r�c��yrXrGr�s        rIr�r�zr�rHc��yrXrGr�s        rIr�r��r�rHTc��|xsd}|xsd}t||�r	d|vr|dz
}tj|�t|t�rtj
|�t
|||||��}|j}	t|	|�\}	}}
t|	t�}t|j�}|jd�}d|vr|rtt	|	��|�r8|dk7r"|jjdd	�|_
n(|dk(r#d|jvr|xjdz
c_
|d
k(rXt|	t�r$tj d)|	|jd�|��}	�n�tj d)|	|jd�|��}	�nh|d
k(rt#�|	fd|ji|��}	�nD|dk(r�t%|	|jfi|��}	|	j&jdk(�r|
j)|	�|	j&j+�}
t-|
�dk(r+|	j&j/|
j��}	�n�|
st1d|����t1d|
����|dk(r�|j3d|j�t|	t�rt5d)d|	i|��}	n
t5d)d|	i|��}	t|	t4�sJ�d|	j&jv�r|
j)|	�|	j&j7�}t-|�dk(r%|	j&j9|d�}|�J�|}	n�|st1d|����t1d|����|dk(rt;�|	|jfi|��}	nw|dk(rbt=d�}d|jvrd|j>d)i|��i}nd|j@d)i|��i}|j.|	fd|ji|��}	nd|��}t1|��t|	t�rJ�|
j)|	�nvt|	t�rf|jBr3d|jvr%t/|	|j|jB|d	��}	nt/|	|j�}	|
j)|	�d}|s7|jd k(r(t|	tD�rtG|	|jB�!�}	n�|r�|s|st|	|j�r�tI|	d"�rtI|	d#�rtI|	d$�stK|	�}	tM|	|jB|d	��}	|
j)|	�t|jt�xs|jN}d|jvr.tI|	d%�s"tQd&tS|j��d'���|
jU�|jNr7t|jt�rJ�|
j)|j�tW|	|
||j�(�S)*a#
    Get file handle for given path/buffer and mode.

    Parameters
    ----------
    path_or_buf : str or file handle
        File path or object.
    mode : str
        Mode to open path_or_buf with.
    encoding : str or None
        Encoding to use.
    {compression_options}

           May be a dict with key 'method' as compression mode
           and other keys as compression options if compression
           mode is 'zip'.

           Passing compression options as keys in dict is
           supported for compression modes 'gzip', 'bz2', 'zstd' and 'zip'.

        .. versionchanged:: 1.4.0 Zstandard support.

    memory_map : bool, default False
        See parsers._parser_params for more information. Only used by read_csv.
    is_text : bool, default True
        Whether the type of the content passed to the file/buffer is string or
        bytes. This is not the same as `"b" not in mode`. If a string content is
        passed to a binary file/buffer, a wrapper is inserted.
    errors : str, default 'strict'
        Specifies how encoding and decoding errors are to be handled.
        See the errors argument for :func:`open` for a full list
        of options.
    storage_options: StorageOptions = None
        Passed to _get_filepath_or_buffer

    Returns the dataclass IOHandles
    �utf-8�strictr�)r=r?r>r�r��rr�r�r-r�)�filenamer>)�fileobjr>r�r>r��zZero files found in ZIP file z9Multiple files found in ZIP file. Only one file per ZIP: r��namer�rz Zero files found in TAR archive zDMultiple files found in TAR archive. Only one file per TAR archive: r��	zstandard�dctx�cctxr�)r=r��newlineF�rb)r=�readable�writable�seekabler�z1Expected file path name or file-like object, got z type)rLrNrOr?rG),�_is_binary_mode�codecs�lookuprQr<�lookup_errorr�r;�_maybe_memory_mapr�r?r�r�r>r�r��GzipFiler"�
_BytesZipFile�buffer�append�namelist�lenr�r}�
setdefault�
_BytesTarFile�getnames�extractfiler#r$�ZstdDecompressor�ZstdCompressorr=r�_BytesIOWrapperr��
_IOWrapperrrAr�r��reverserK)r�r>r=r?r�r�r�r��ioargsrL�handles�is_pathr��	zip_names�files�filer��	open_argsr�rOs                    rIr�r��s��d�"�7�H�
�
�x�F��{�D�)�c��o������M�M�(���&�#�����F�#�%����
�'��F��
&�
&�F�
#4�F�J�"G��F�J�����%�G��F�.�.�/��"�&�&�x�0�K��$��7��s�6�{�+���&� � �+�+�-�-�c�2�6�F�K�
�F�
"�s�&�+�+�'=�
�K�K�3��K��&� ��&�#�&�����#�����'�������#����	�
'����E�
!�$�\�^����[�[��#��F��E�
!�#������'7��F��}�}�!�!�S�(����v�&�"�M�M�2�2�4�	��y�>�Q�&�#�]�]�/�/�	�
�
��@�F�"�$�'D�[�M�%R�S�S�$�2�2;��>����E�
!��'�'�����<��&�#�&�&�G�F�G�6F�G��
'��"��&6����f�m�4�4�4��f�m�m�(�(�(����v�&��
�
�.�.�0���u�:��?�!�=�=�4�4�U�1�X�>�D��+�+�+�!�F��$�'G��}�%U�V�V�$�:�:?��B����D�
 �%�]�_������'7��F�
�F�
"�-�k�:�D��f�k�k�!�#�%:�T�%:�%:�%N�=M�%N�O�	�#�%8�T�%8�%8�%L�;K�%L�M�	��T�Y�Y����[�[����F�4�K�=�A�C��S�/�!��f�c�*�*�*����v��	�F�C�	 ��?�?�s�&�+�+�5������������F��&�&�+�+�.�F����v���J��v�{�{�d�*�z�&�*�/M� ���_�_�
��
��z�_�V�V�[�[�%I���
�+��6�:�.��6�:�.���'�F����_�_���	
��	���v��
�v�0�0�#�6�M�&�:M�:M�
�
��f�k�k��'�&�&�"9��
���1�1�2�3�5�
:�
�	
�
�O�O��
����f�7�7��=�=�=����v�0�0�1��� ���&�&�
�
rHc�D��eZdZdZe�Zedd��Zd�fd�Z�xZ	S)�_BufferedWriterz�
    Some objects do not support multiple .write() calls (TarFile and ZipFile).
    This wrapper writes to the underlying buffer on close.
    c��yrXrGrYs rI�write_to_bufferz_BufferedWriter.write_to_buffer�s��rHc�*��|jry|j�jr7|jd�|j5|j�ddd�n|jj
�t�|��y#1swY�xYw)Nr)�closed�	getbuffer�nbytes�seekr
r$rU�super)rV�	__class__s �rIrUz_BufferedWriter.close�se����;�;���>�>��"�"��I�I�a�L�����$�$�&���
�K�K����
��
��	��s�B	�	Br`)
rBrCrDrErr
rr$rU�
__classcell__�r+s@rIr"r"�s-����
�Y�F������rHr"c�T��eZdZ				d									d�fd�
Zdd�Zdd�Zd	d�Z�xZS)
rc���t�|��||_||_t	j
jd||j|�|d�|��|_y)N)r�r>r�rG)	r*�__init__�archive_namer��tarfile�TarFiler��extend_moder
)rVr�r>r�r1r�r+s      �rIr0z_BytesTarFile.__init__�sZ���	����(�����	�(/���';�';�(
���!�!�$�'��(
��	(
��rHc��|jdd�}|dk7r|S|j�-t|j�j}|dvr
|�d|dd��}|S)Nr�r-r�)r�r�r��:r�)r�r�r�suffix)rVr>r7s   rIr4z_BytesTarFile.extend_mode�s_���|�|�C��$���3�;��K��9�9� ��$�)�)�_�+�+�F��/�/���q������-���rHc�"�|j�yt|j�}|jdk(r|jd�jS|jdvr*|jd�jd�jS|jS)z�
        If an explicit archive_name is not given, we still want the file inside the zip
        file not to be named something.tar, because that causes confusion (GH39465).
        Nr�r-)r�r�r�)r�rr7�with_suffix�rVr�s  rI�infer_filenamez_BytesTarFile.infer_filename�sz��
�9�9�����	�	�?���?�?�f�$��'�'��+�0�0�0�
�_�_� B�
B��'�'��+�7�7��;�@�@�@��}�}�rHc���|jxs|j�xsd}tj|��}t	|j��|_|jj||�y)Nr�)r�)	r1r;r2�TarInfor�getvalue�sizer
�addfile)rVr1�tarinfos   rIr$z_BytesTarFile.write_to_buffer�sT���(�(�J�D�,?�,?�,A�J�U���/�/�|�4���4�=�=�?�+��������G�T�*rH)Nr�NN)
r��
str | Noner>zLiteral['r', 'a', 'w', 'x']r�z-ReadBuffer[bytes] | WriteBuffer[bytes] | Noner1rBrarb)r>r<rar<�rarBr`)rBrCrDr0r4r;r$r,r-s@rIrr�sU��� �,/�AE�#'�
��
�*�
�?�	
�
!�
�
�
�(�
�+rHrc�B��eZdZ	d							d�fd�
Zdd�Zdd�Z�xZS)rc����t�|��|jdd�}||_|j	dt
j�tj||fi|��|_y)Nr�r-r?)	r*r0r�r1r�zipfile�ZIP_DEFLATED�ZipFiler
)rVrr>r1r�r+s     �rIr0z_BytesZipFile.__init__�s]���	�����|�|�C��$��(������-��)=�)=�>�(/����$�(
� �(
��rHc��t|jjtjt
f�rUt
|jj�}|jdk(r|jd�jS|jSy)z�
        If an explicit archive_name is not given, we still want the file inside the zip
        file not to be named something.zip, because that causes confusion (GH39465).
        r�r-N)
rQr
r�rsr�r<rr7r9r�r:s  rIr;z_BytesZipFile.infer_filenamese��
�d�k�k�*�*�R�[�[�#�,>�?��D�K�K�0�0�1�H����&�(��+�+�B�/�4�4�4��=�=� �rHc��|jxs|j�xsd}|jj||j	��y)Nr�)r1r;r
�writestrr>)rVr1s  rIr$z_BytesZipFile.write_to_buffers:���(�(�J�D�,?�,?�,A�J�U�������\�4�=�=�?�;rHrX)rz1FilePath | ReadBuffer[bytes] | WriteBuffer[bytes]r>r<r1rBrarbrCr`)rBrCrDr0r;r$r,r-s@rIrr�s=���
$(�	
�?�
��
�!�	
�
�

�$
�<rHrc�4�eZdZdd�Zdd�Zd	d�Zd	d�Zd	d�Zy)
rc��||_yrX)r
)rVr
s  rIr0z_IOWrapper.__init__*s	����rHc�.�t|j|�SrX��getattrr
)rVr�s  rI�__getattr__z_IOWrapper.__getattr__-����t�{�{�D�)�)rHc�d�t|jd�r|jj�Sy)NrT)r�r
rrYs rIrz_IOWrapper.readable0�&���4�;�;�
�+��;�;�'�'�)�)�rHc�d�t|jd�r|jj�Sy)NrT)r�r
rrYs rIrz_IOWrapper.seekable5rTrHc�d�t|jd�r|jj�Sy)NrT)r�r
rrYs rIrz_IOWrapper.writable:rTrHN)r
r rarb)r�r<)rar@)rBrCrDr0rQrrrrGrHrIrr#s���*��
�
rHrc�(�eZdZddd�Zdd�Zdd	d�Zy)
rc�.�||_||_d|_y)NrH)r
r=�overflow)rVr
r=s   rIr0z_BytesIOWrapper.__init__Cs����� ��
�
��
rHc�.�t|j|�SrXrO)rV�attrs  rIrQz_BytesIOWrapper.__getattr__LrRrHc��|j�J�|jj|�j|j�}|j|z}|�|dks|t|�k\r	d|_|S|d|}||d|_|S)NrrH)r
r��encoder=rYr)rV�n�
bytestring�combined_bytestring�	to_returns     rIr�z_BytesIOWrapper.readOs����{�{�&�&�&��[�[�%�%�a�(�/�/��
�
�>�
�"�m�m�j�8���9��A���c�*=�&>�!>��D�M�&�&�+�B�Q�/�I�/���3�D�M��rHN)r�)r
zStringIO | TextIOBaser=r<rarb)r[r<)���)r^z
int | Nonerar�)rBrCrDr0rQr�rGrHrIrr@s���*�rHrc���g}|t|d�xst|t�z}|s|||fStt|�}t|t�rt|d�}|j
|�	ttj|j�dtj���}t|�D]}|j��	|||gfS#t|�D]}|j��wxYw)zTry to memory map file/buffer.�filenorr)�access)
r�rQr<rr!r�rrr�rd�ACCESS_READ�reversedrU)rLr�r�wrappeds    rIr
r
]s���!#�G��'�&�(�+�F�z�&�#�/F�F�J���z�7�*�*��-��
(�F��&�#���f�d�#�����v�����I�I��
�
���4�+;�+;�
�
���w�'�F��L�L�N�(��J��	�)�)��	�w�'�F��L�L�N�(�s�)=C
�
"C/c��d}t|�}t|t�s|S	tjj|�}|S#ttf$rY|SwxYw)zTest whether file exists.F)r�rQr<rsrt�existsr�r})r;rjs  rI�file_existsrks`��
�F�'�(:�;���(�#�.��
�
������ 2�3���M��
�z�"�
���M�
�s�A�A�Ac���d|vsd|vrd|vStjtjtjf}t	t|�|�ryt
|t��xsdt|d|�vS)z+Whether the handle is opened in binary moder�r�Fr>)	r�StreamWriter�StreamReader�StreamReaderWriter�
issubclassr�rQ�_get_binary_io_classesrP)rLr>�text_classess   rIrr�s����d�{�c�T�k��d�{��
	�������!�!�	�L��$�v�,��-���f�4�6�7��3�'����C�<�rHc���ttf}tdd��}|�9|j�j	d�5}|t|�fz
}ddd�|S|S#1swY|SxYw)z!IO classes that that expect bytesr��ignore)r�NrH)r
rr$r�
stream_readerr�)�binary_classesr�r�s   rIrqrq�sk��)7�	�'B�N�&�k�(�C�D���
�
"�
"�
$�
2�
2�3�
7�6��t�F�|�o�-�N�8���>��8���s�A�A!c�����t�t�rg�tt|�xr't|t�xrt	�fd�|D���S)a�
    Check whether or not the `columns` parameter
    could be converted into a MultiIndex.

    Parameters
    ----------
    columns : array-like
        Object which may or may not be convertible into a MultiIndex
    index_col : None, bool or list, optional
        Column or columns to use as the (possibly hierarchical) index

    Returns
    -------
    bool : Whether or not columns could become a MultiIndex
    c3�Z�K�|]"}|t��vs�t|t����$y�wrX)rerQr�)ry�c�	index_cols  �rIr{z+is_potential_multi_index.<locals>.<genexpr>�s$�����R�g���$�y�/�9Q�
�1�e�$�g�s�+�+)rQr@rr+r~)�columnsrzs `rI�is_potential_multi_indexr|�sT���&��J�y�$�7��	���G��	S��7�M�2�2�	S��R�g�R�R��rHc��t|�}tt�}t|�D]\\}}||}|dkDr@|dz||<|r$t	|t
�sJ�|dd|d�d|��fz}n|�d|��}||}|dkDr�@|||<|dz||<�^|S)a:
    Rename column names if duplicates exist.

    Currently the renaming is done by appending a period and an autonumeric,
    but a custom pattern may be supported in the future.

    Examples
    --------
    >>> dedup_names(["x", "y", "x", "x"], is_potential_multiindex=False)
    ['x', 'y', 'x.1', 'x.2']
    rr�Nrb�.)rerr|�	enumeraterQr�)�names�is_potential_multiindex�countsrz�col�	cur_counts      rI�dedup_namesr��s���
��K�E�)4�S�)9�F��E�"���3��3�K�	��!�m�#�a�-�F�3�K�&�!�#�u�-�-�-��#�2�h�S��W�I�Q�y�k�":�!<�<����Q�y�k�*���s��I��!�m���a���!�m��s��#�"�LrH)rk�objectrar@)r;r<rar<)r;r.rar.)r;�str | BaseBufferTrar�)r�r�rarb).)r;r3r�r@rar<)r;r.r�r@rar.)F)r;zFilePath | BaseBufferTr�r@rar�)rk�FilePath | BaseBufferrar@)r�Nr�N)r;r�r=r<r?�CompressionOptions | Noner>r<r��StorageOptions | Nonerar9)rtr<rar<)r?r2raz"tuple[str | None, CompressionDict])r;r�r?rBrarB)rtz
Path | strrarb)r�r�r>r<r=rBr?r2r�r@r�zLiteral[False]r�rBr�r5razIOHandles[bytes])r�r�r>r<r=rBr?r2r�r@r�z
Literal[True]r�rBr�r5razIOHandles[str])r�r�r>r<r=rBr?r2r�r@r�r@r�rBr�r5ra�!IOHandles[str] | IOHandles[bytes])r�r�r>r<r=rBr?r�r�r@r�r@r�rBr�r�rar�)rLr:r�r@raz/tuple[str | BaseBuffer, bool, list[BaseBuffer]])r;r�rar@)rLr�r>r<rar@)raztuple[type, ...]rX)r{zSequence[Hashable] | MultiIndexrzzbool | Sequence[int] | Nonerar@)r��Sequence[Hashable]r�r@rar�)trE�
__future__r�abcrrr�collectionsr�collections.abcrrr	rc�	functoolsr��ior
rrr
rrr�rs�pathlibr�rer2�typingrrrrrrrrrr�urllib.parserrrgrrrr�rF�pandas._typingr r!�
pandas.compatr"r#�pandas.compat._optionalr$�pandas.util._decoratorsr%�pandas.util._exceptionsr&�pandas.core.dtypes.commonr'r(r)r*�pandas.core.dtypes.genericr+�pandas.core.shared_docsr,�setri�discard�compiler�r.�typesr0r1r2r3r4r5r6�pandasr7�	dataclassr9rKrlror�r�r�r�r�r�r��valuesr�r�r�r�r�r"rrrrr
rkr�	lru_cacherqr|r�rGrHrI�<module>r�s����"���#���
������	��	�����������?�'�4���5�0��-�+�-��;�<�����B���B�J�J�?�@���m�:�6���#���"�
���	�	��	�
���.����.��.�b0�$
��
��
��
���&C�:
��
��
�?B��#��8<����
��$�,�.�,��,��,�D3�	�� �!2�3�$�%:�;�>R�R���-1��-1�l�-�l��l�+�l��	l�
+�l��
l�	�l�^0�&
���������
���6�=�=�?�@�� 0�#� 0�'� 0�F��&;�<�?S�S�T�3�-�3�<F�3��3�U�3�lV�
�
�&)���&)��&��

���	�
$���
���
��$����
��
�
�&)�� ��&)��&��

���	�
$���
���
��$����
��
�
�&)����&)��&��

���	�
$���
���
��$��'��
����&;�<�}�L�M�
 �-1����-1�P�&�P�

�P��	P�
+�P��
P��P�
�P�+�P�'�P�N�P�j�g�s��43+�O�3+�l"<�O�"<�J��:��:*��*�*.�*�4�*�D��*������&.2��
,��*��
��:"��"�8<�"��"rH

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