183
def invert_dictset(d):
184
"""Invert a dictionary with keys matching a set of values, turned into lists."""
185
# Based on recipe from ASPN
187
for k, c in d.items():
189
keys = result.setdefault(v, [])
195
"""Invert a dictionary with keys matching each value turned into a list."""
196
# Based on recipe from ASPN
198
for k, v in d.items():
199
keys = result.setdefault(v, [])