from typing import Union
from pathlib import Path
from typing import Any
import pickle


def read_pkl(pkl: Union[str, Path]) -> Any:
    """
    Read pickle file.

    Parameters
    ----------
    pkl : str or pathlib.Path
    The path od pickle file.

    Returns
    -------
    obj : Any
    Restored object.
    """
    with open(pkl, "rb") as f:
        obj = pickle.load(f)
        return obj