input: Write a function that takes a dictionary as an argument and returns an inverted dictionary where the keys are the values of the original dictionary and the values are lists of keys from the original dictionary that had those values. If a value appears more than once in the original dictionary, the corresponding list in the inverted dictionary will have more than one element. If the input dictionary is empty, the function should return an empty dictionary.
  
  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': 1}) == {1: ['a', 'c'], 2: ['b']}
  assert invert_dictionary({'x': 'apple', 'y': 'orange', 'z': 'apple'}) == {'apple': ['x', 'z'], 'orange': ['y']}
  assert invert_dictionary({'name': 'John', 'age': 30, 'city': 'New York'}) == {'John': ['name'], 30: ['age'], 'New York': ['city']}
  assert invert_dictionary({}) == {}
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