from pathlib import Path
import dill


def load_HMM(save_as):
    """Load HMM from `xp.com` from given dir."""
    save_as = Path(save_as).expanduser()
    HMM = dill.load(open(save_as / "xp.com", "rb"))["HMM"]
    return HMM