input: Write a function to invert a dictionary. This 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 had the corresponding value. If the given dictionary is empty, it should return an empty dictionary.
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 1})=={1: ['a', 'c'], 2: ['b']}
  assert invert_dictionary({'name': 'Alice', 'age': 25, 'city': 'Wonderland'})=={25: ['age'], 'Alice': ['name'], 'Wonderland': ['city']}
  assert invert_dictionary({'x': 1, 'y': 1, 'z': 1})=={1: ['x', 'y', 'z']}
  assert invert_dictionary({'A': 3, 'B': 4, 'C': 3})=={3: ['A', 'C'], 4: ['B']}
  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