input: Write a function to generate an inverted dictionary from a given dictionary. The function should return a new dictionary where the keys are the values from the original dictionary and the values are lists of the keys that had that value in the original dictionary.
  assert invert_dictionary({})=={}
  assert invert_dictionary({"a": 1, "b": 2})=={1: ["a"], 2: ["b"]}
  assert invert_dictionary({"a": 1, "b": 2, "c": 1})=={1: ["a", "c"], 2: ["b"]}
  assert invert_dictionary({"a": "x", "b": "y", "c": "x"})=={"x": ["a", "c"], "y": ["b"]}
  assert invert_dictionary({"a": [1, 2], "b": [2, 3]})=={[1, 2]: ["a"], [2, 3]: ["b"]}
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