def read_pickle(path, compression='<STR_LIT>'):
path = _stringify_path(path)<EOL>f, fh = _get_handle(path, '<STR_LIT:rb>', compression=compression, is_text=False)<EOL>try:<EOL><INDENT>with warnings.catch_warnings(record=True):<EOL><INDENT>warnings.simplefilter("<STR_LIT:ignore>", Warning)<EOL>return pickle.load(f)<EOL><DEDENT><DEDENT>except Exception:  <EOL><INDENT>try:<EOL><INDENT>return pc.load(f, encoding=None)<EOL><DEDENT>except Exception:  <EOL><INDENT>return pc.load(f, encoding='<STR_LIT>')<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>f.close()<EOL>for _f in fh:<EOL><INDENT>_f.close()<EOL><DEDENT><DEDENT>
Load pickled pandas object (or any object) from file.

.. warning::

   Loading pickled data received from untrusted sources can be
   unsafe. See `here <https://docs.python.org/3/library/pickle.html>`__.

Parameters
----------
path : str
    File path where the pickled object will be loaded.
compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None}, default 'infer'
    For on-the-fly decompression of on-disk data. If 'infer', then use
    gzip, bz2, xz or zip if path ends in '.gz', '.bz2', '.xz',
    or '.zip' respectively, and no decompression otherwise.
    Set to None for no decompression.

    .. versionadded:: 0.20.0

Returns
-------
unpickled : same type as object stored in file

See Also
--------
DataFrame.to_pickle : Pickle (serialize) DataFrame object to file.
Series.to_pickle : Pickle (serialize) Series object to file.
read_hdf : Read HDF5 file into a DataFrame.
read_sql : Read SQL query or database table into a DataFrame.
read_parquet : Load a parquet object, returning a DataFrame.

Examples
--------
>>> original_df = pd.DataFrame({"foo": range(5), "bar": range(5, 10)})
>>> original_df
   foo  bar
0    0    5
1    1    6
2    2    7
3    3    8
4    4    9
>>> pd.to_pickle(original_df, "./dummy.pkl")

>>> unpickled_df = pd.read_pickle("./dummy.pkl")
>>> unpickled_df
   foo  bar
0    0    5
1    1    6
2    2    7
3    3    8
4    4    9

>>> import os
>>> os.remove("./dummy.pkl")