def inverted_dict_of_lists(d):
new_dict = {}<EOL>for (old_key, old_value_list) in viewitems(dict(d)):<EOL><INDENT>for new_key in listify(old_value_list):<EOL><INDENT>new_dict[new_key] = old_key<EOL><DEDENT><DEDENT>return new_dict<EOL>
Return a dict where the keys are all the values listed in the values of the original dict

    >>> inverted_dict_of_lists({0: ['a', 'b'], 1: 'cd'}) == {'a': 0, 'b': 0, 'cd': 1}
    True