input: Write a function to invert a given dictionary where each value becomes a key and keys corresponding to the same value are collected into a list. Return the new dictionary. If the input dictionary is empty, return an empty dictionary.
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 1}) == {1: ['a', 'c'], 2: ['b']}
  assert invert_dictionary({'a': 3, 'b': 3, 'c': 3}) == {3: ['a', 'b', 'c']}
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 3}) == {1: ['a'], 2: ['b'], 3: ['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