Generate a Python function that takes a dictionary as an argument and returns an inverted dictionary.
Not applicable
def invert_dictionary(d):
 inverted_d = {}

 for key, value in d.items():
 if value not in inverted_d:
 inverted_d[value] = []
 inverted_d[value].append(key)

 return inverted_d