gL i`ddlmZddlZddlZddlZddlZddlmZmZm Z ddl Z ddl Z ddl m Z mZddlmZddlZddlmZerddlmZmZddlmZmZ d dd Zd dd Zd dd Zddd Zy)) annotationsN) TYPE_CHECKINGAnyCallable) get_bz2_file get_lzma_file)import_optional_dependency) ensure_clean)FilePathReadPickleBuffer) DataFrameSeriesc|}|dtjd}t|5}tj||tj |cdddS#1swYyxYw)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)uuiduuid4r pd to_pickle read_pickle)objpath_path temp_paths Y/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pandas/_testing/_io.pyround_trip_pickler's[$ E }TZZ\N), e )  S)$~~i()))s +AA&ctj}|d}t|5}||||||}ddd|S#1swYSxYw)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___)pathlibPathr )writerreaderrrrs rround_trip_pathlibr"AsY$ <rr;typingrrrrr9 pandas.compatrrpandas.compat._optionalr pandasrpandas._testing.contextsr pandas._typingr r r rrr"r)rOrr]st"   ?1 :>) )6))46:1"r\