def dict_invert(d):
  """inverts a dictionary with immutable values
  
  Takes in a dictionary with immutable values and returns the inverse of the 
  dictionary. The inverse of a dictionary d is another dictionary whose keys 
  are the unique dictionary values in d. The value for a key in the inverse 
  dictionary is a sorted list of all keys in d that have the same value in d.
  
  Decorators:
    guenther.wasser
  
  Args:
    d ([dict]): dictionary with immutable values
  """
  newDict = {}
  for x in d.values():
    newDict[x] = []
  for v in d.keys():
    newDict[d[v]] += [v,]
  for x in newDict.keys():
    if len(newDict[x]) > 1:
      newItem = newDict[x]
      newDict[x] = sorted(newItem)
  return newDict