def flattenDict(dict):
    """
    Takes a dictionary with aggregated values and turns each value into a key
    with the aggregated key (from dict) as the corresponding value.
    """
    flat_dict =  {p: g for g, sublist in dict.items() for p in sublist}
    return flat_dict