input: Write a function to invert a dictionary where each value becomes a key and the original keys are grouped into lists as the values. If a value appears multiple times, the keys are collected in the list associated with that value.
  
  def invert_dictionary(d):
      inverted_d = {}
  
      for key, value in d.items():
          if value not in inverted_d:
              inverted_d[value] = []
          inverted_d[value].append(key)
  
      return inverted_d
  
  assert invert_dictionary({'a': 1, 'b': 2, 'c': 2})=={1: ['a'], 2: ['b', 'c']}
  assert invert_dictionary({'x': 'apple', 'y': 'banana', 'z': 'apple'})=={'apple': ['x', 'z'], 'banana': ['y']}
  assert invert_dictionary({})=={}
  assert invert_dictionary({'one': 1})=={1: ['one']}
  assert invert_dictionary({'a': 'alpha', 'b': 'beta', 'c': 'gamma'})=={'alpha': ['a'], 'beta': ['b'], 'gamma': ['c']}
output: def invert_dictionary(d):
      inverted_d = {}
  
      for key, value in d.items():
          if value not in inverted_d:
              inverted_d[value] = []
          inverted_d[value].append(key)
  
      return inverted_d