input: Write a function to generate an inverted dictionary from a given dictionary. The function should take a dictionary as an argument and return a new dictionary where the keys are the values from the original dictionary, and the values are lists of keys from the original dictionary that mapped to those values. If a value in the original dictionary appears more than once, its corresponding list in the inverted dictionary should contain all the keys that mapped to that value. If the given dictionary is empty, the function should return an empty dictionary.
  assert invert_dictionary({'name': 'Alice', 'age': 25, 'city': 'Wonderland'}) == {'Alice': ['name'], 25: ['age'], 'Wonderland': ['city']}
  assert invert_dictionary({'fruit': 'apple', 'color': 'red', 'taste': 'sweet'}) == {'apple': ['fruit'], 'red': ['color'], 'sweet': ['taste']}
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 2}) == {1: ['a'], 2: ['b', 'c']}
  assert invert_dictionary({}) == {}
output: def invert_dictionary(d):
      inverted = {}
      for key, value in d.items():
          if value in inverted:
              inverted[value].append(key)
          else:
              inverted[value] = [key]
      return inverted