code: def invertDictMapping(d):
      
      inv_map = {}
      for k, v in d.items():
          inv_map[v] = inv_map.get(v, [])
          inv_map[v].append(k)
      return inv_map
docs: Invert mapping of dictionary (i.e. map values to list of keys)