import pickle


def load_pickle(parent_dir):
    """
    Accepts a parent directory Path object
    which can contain only one pickled file with a .pkl extension
    Finds the file, loads it, and returns it
    """
    # print(parent_dir)
    filepath = list(parent_dir.glob('*.pkl'))[0]
    with open(str(filepath), 'rb') as f:
        data = pickle.load(f)
    return data