§
    ªöÉg`  ã                  óÔ   — d dl mZ d dlZd dlZd dlZd dlZd dlmZmZm	Z	 d dl
Z
d dlZd dlmZmZ d dlmZ d dlZd dlmZ erd dlmZmZ d dlmZmZ 	 ddd„Zddd„Zddd„Zddd„ZdS )é    )ÚannotationsN)ÚTYPE_CHECKINGÚAnyÚCallable)Úget_bz2_fileÚget_lzma_file)Úimport_optional_dependency)Úensure_clean)ÚFilePathÚReadPickleBuffer)Ú	DataFrameÚSeriesÚobjr   Úpathú"FilePath | ReadPickleBuffer | NoneÚreturnúDataFrame | Seriesc                óÜ   — |}|€dt          j        ¦   «         › d�}t          |¦  «        5 }t          j        | |¦  «         t          j        |¦  «        cddd¦  «         S # 1 swxY w Y   d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.
    NÚ__z	__.pickle)ÚuuidÚuuid4r
   ÚpdÚ	to_pickleÚread_pickle)r   r   Ú_pathÚ	temp_paths       ú_/var/www/html/nodeJS/PythonScripts/venv3.11/lib/python3.11/site-packages/pandas/_testing/_io.pyÚround_trip_pickler   '   s²   € ð$ €EØ€}Ø,•T”Z‘\”\Ð,Ð,Ð,ˆÝ	�eÑ	Ô	ð ) 	Ý
Œ�S˜)Ñ$Ô$Ð$ÝŒ~˜iÑ(Ô(ð)ð )ð )ð )ñ )ô )ð )ð )ð )ð )ð )ð )øøøð )ð )ð )ð )ð )ð )s   «)A!Á!A%Á(A%ú
str | Nonec                óÄ   — t           j        }|€d}t          |¦  «        5 } |  ||¦  «        ¦  «          | ||¦  «        ¦  «        }ddd¦  «         n# 1 swxY w Y   |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.
    NÚ___pathlib___)ÚpathlibÚPathr
   )ÚwriterÚreaderr   r#   r   s        r   Úround_trip_pathlibr&   A   s«   € õ$ Œ<€DØ€|ØˆÝ	�dÑ	Ô	ð !˜tØˆˆtˆt�D‰zŒzÑÔÐØˆf�T�T˜$‘Z”ZÑ Ô ˆð!ð !ð !ñ !ô !ð !ð !ð !ð !ð !ð !øøøð !ð !ð !ð !ð €Js    )AÁAÁAc                óè   — ddl }|                     d¦  «        j        }|€d}t          |¦  «        5 } |  ||¦  «        ¦  «          | ||¦  «        ¦  «        }ddd¦  «         n# 1 swxY w Y   |S )aá  
    Write an object to file specified by a py.path LocalPath 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.
    r   Nzpy.pathÚ___localpath___)ÚpytestÚimportorskipÚlocalr
   )r$   r%   r   r)   Ú	LocalPathr   s         r   Úround_trip_localpathr-   \   sÃ   € ð$ €M€M€Mà×#Ò# IÑ.Ô.Ô4€IØ€|Ø ˆÝ	�dÑ	Ô	ð &˜tØˆˆyˆy˜‰ŒÑÔÐØˆf�Y�Y˜t‘_”_Ñ%Ô%ˆð&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &ð €Js   ²)A'Á'A+Á.A+ÚtestÚdestÚstrÚNonec                ó@  — |f}d}d}| dk    rt           j        }d}||f}d}nÂ| dk    rRt          j        }d}t          j        |¬¦  «        }t          j        |¦  «        }	t          |¦  «        |_        ||	f}d}nj| d	k    rt          j
        }nW| d
k    rt          ¦   «         }nB| dk    rt          d¦  «        j        }n'| dk    rt          ¦   «         }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Úbz2ÚzstdÚ	zstandardÚxzzUnrecognized compression type: )ÚmodeN)ÚzipfileÚZipFileÚtarfileÚTarFileÚTarInfoÚioÚBytesIOÚlenÚsizer;   ÚGzipFiler   r	   Úopenr   Ú
ValueErrorÚgetattr)Úcompressionr   Údatar/   Úargsr@   ÚmethodÚcompress_methodÚfileÚbytesÚfs              r   Úwrite_to_compressedrV   y   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   Ã2DÄDÄD)N)r   r   r   r   r   r   )r   r   )r.   )r/   r0   r   r1   )Ú
__future__r   r;   rF   r"   rC   Útypingr   r   r   r   rA   Úpandas.compatr   r   Úpandas.compat._optionalr	   Úpandasr   Úpandas._testing.contextsr
   Úpandas._typingr   r   r   r   r   r&   r-   rV   © ó    r   ú<module>r`      s¦  ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø 	€	€	€	Ø €€€Ø €€€ðð ð ð ð ð ð ð ð ð ð
 €€€Ø €€€ðð ð ð ð ð ð ð ð ?Ð >Ð >Ð >Ð >Ð >à Ð Ð Ð Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1àð 	ðð ð ð ð ð ð ð ð
ð ð ð ð ð ð ð ð :>ð)ð )ð )ð )ð )ð4ð ð ð ð ð6ð ð ð ð ð:1"ð 1"ð 1"ð 1"ð 1"ð 1"ð 1"r_   