import pickle


def load_data(pathToPickleFile):
    """
    Read in pickled file or dir.
    File:  ground_truth_dict = load_data('ground_truth.pkl')
    Dir:   ground_truth_dict = load_data(os.path.join(output_dir, 'ground_truth.pkl'))
    :param pathToPickleFile: pickled file to read in, e.g. 'dataset.pkl'
    :return: the data from the pickled file
    """
    with open(pathToPickleFile, 'rb') as pickle_file:
        data = pickle.load(pickle_file)
    return data