input: Write a function to invert 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 had the corresponding values.
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 1})=={1: ['a', 'c'], 2: ['b']}
  assert invert_dictionary({'apple': 'fruit', 'carrot': 'vegetable', 'banana': 'fruit'})=={'fruit': ['apple', 'banana'], 'vegetable': ['carrot']}
  assert invert_dictionary({})=={}
  assert invert_dictionary({'one': 1, 'two': 2, 'three': 3})=={1: ['one'], 2: ['two'], 3: ['three']}
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