§
    tŠtjŒ  ã                  óœ   — d dl mZ d dlZd dlZd dlZd dlmZmZ d dlZd dl	m
Z
 d dlZerd dlmZ d dlmZ d dlmZmZ dd„Zdd„Zddd„ZdS )é    )ÚannotationsN)ÚTYPE_CHECKINGÚAny)Úimport_optional_dependency)ÚCallable)ÚPath)Ú	DataFrameÚSeriesÚobjr   Útmp_pathr   ÚreturnúDataFrame | Seriesc                óT   — t          j        | |¦  «         t          j        |¦  «        S )a�  
    Pickle an object and then read it again.

    Parameters
    ----------
    obj : any object
        The object to pickle and then re-read.
    path : str, path object or file-like object, default None
        The path where the pickled object is written and then read.

    Returns
    -------
    pandas object
        The original object that was pickled and then re-read.
    )ÚpdÚ	to_pickleÚread_pickle)r   r   s     úQ/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/pandas/_testing/_io.pyÚround_trip_pickler      s&   € õ  „L��hÑÔÐÝŒ>˜(Ñ#Ô#Ð#ó    c                ó2   —  | |¦  «          ||¦  «        }|S )aÛ  
    Write an object to file specified by a pathlib.Path and read it back

    Parameters
    ----------
    writer : callable bound to pandas object
        IO writing function (e.g. DataFrame.to_csv )
    reader : callable
        IO reading function (e.g. pd.read_csv )
    path : str, default None
        The path where the object is written and then read.

    Returns
    -------
    pandas object
        The original object that was serialized and then re-read.
    © )ÚwriterÚreaderr   r   s       r   Úround_trip_pathlibr   1   s(   € ð$ €Fˆ8ÑÔÐØ
ˆ&�Ñ
Ô
€CØ€Jr   ÚtestÚpathÚstrÚdestÚNonec                ó4  — |f}d}d}| dk    rt           j        }d}||f}d}n¼| dk    rRt          j        }d}t          j        |¬¦  «        }t          j        |¦  «        }	t          |¦  «        |_        ||	f}d}nd| d	k    rt          j
        }nQ| d
k    rddl}
|
j        }n?| dk    rt          d¦  «        j        }n$| dk    rddl}|j        }nt#          d| › �¦  «        ‚ |||¬¦  «        5 } t%          ||¦  «        |Ž  ddd¦  «         dS # 1 swxY w Y   dS )a¦  
    Write data to a compressed file.

    Parameters
    ----------
    compression : {'gzip', 'bz2', 'zip', 'xz', 'zstd'}
        The compression type to use.
    path : str
        The file path to write the data.
    data : str
        The data to write.
    dest : str, default "test"
        The destination file (for ZIP only)

    Raises
    ------
    ValueError : An invalid compression value was passed in.
    ÚwbÚwriteÚzipÚwÚwritestrÚtar)ÚnameÚaddfileÚgzipÚbz2r   NÚzstdÚ	zstandardÚxzzUnrecognized compression type: )Úmode)ÚzipfileÚZipFileÚtarfileÚTarFileÚTarInfoÚioÚBytesIOÚlenÚsizer)   ÚGzipFiler*   ÚBZ2Filer   ÚopenÚlzmaÚLZMAFileÚ
ValueErrorÚgetattr)Úcompressionr   Údatar   Úargsr.   ÚmethodÚcompress_methodÚfileÚbytesr*   r;   Úfs                r   Úwrite_to_compressedrG   H   s¤  € ð& "˜G€DØ€DØ€Fð �eÒÐÝ!œ/ˆØˆØ�dˆ|ˆØˆˆØ	˜Ò	Ð	Ý!œ/ˆØˆÝŒ DÐ)Ñ)Ô)ˆÝ”
˜4Ñ Ô ˆÝ˜‘I”IˆŒ	Ø�eˆ}ˆØˆˆØ	˜Ò	Ð	Ýœ-ˆˆØ	˜Ò	Ð	Øˆ
ˆ
ˆ
àœ+ˆˆØ	˜Ò	Ð	Ý4°[ÑAÔAÔFˆˆØ	˜Ò	Ð	Øˆˆˆàœ-ˆˆåÐH¸;ÐHÐHÑIÔIÐIð 
ˆ˜ DÐ	)Ñ	)Ô	)ð "¨QØ���6ÑÔ˜DÐ!Ð!ð"ð "ð "ñ "ô "ð "ð "ð "ð "ð "ð "ð "øøøð "ð "ð "ð "ð "ð "s   Ã,DÄDÄD)r   r   r   r   r   r   )r   r   )r   )r   r   r   r   r   r   )Ú
__future__r   r)   r4   r1   Útypingr   r   r/   Úpandas.compat._optionalr   Úpandasr   Úcollections.abcr   Úpathlibr   r	   r
   r   r   rG   r   r   r   ú<module>rN      s"  ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø 	€	€	€	Ø €€€ðð ð ð ð ð ð ð ð €€€à >Ð >Ð >Ð >Ð >Ð >à Ð Ð Ð àð Ø(Ð(Ð(Ð(Ð(Ð(ØÐÐÐÐÐðð ð ð ð ð ð ð ð$ð $ð $ð $ð(ð ð ð ð.9"ð 9"ð 9"ð 9"ð 9"ð 9"ð 9"r   