def merge_datasets(num_evts_per_dataset):
    """ Return dict `<merged_dataset> : list of <dataset>'

    Associates all datasets in `num_evts_per_dataset' that belong by their
    name to the same PD but to a different run era. For example:
    
    isolated_mu_runa_v1, isolated_mu_runb_v1, isolated_mu_runc_v2 --> isolated_mu

    The returned dict has as value a list of the merged datasets.
    """
    datasets = num_evts_per_dataset.keys()
    merged_datasets = {}
    for dataset in datasets:
        bare_name = dataset[0:dataset.find("run")].rstrip("_")
        if bare_name in merged_datasets:
            merged_datasets[bare_name].append(dataset)
        else:
            merged_datasets[bare_name] = [dataset]

    return merged_datasets