func_code: def swap_unique_keys_values(d):
      tempd = {}
      alltupps = []
      newlist = []
      for k, v in list(d.items()):
          alltupps.append((v, k))
      alltupps = sorted(alltupps)
      i = 0
      while i < len(alltupps) - 1:
          if alltupps[i][0] != alltupps[i + 1][0]:
              newlist.append(alltupps[i])
          else:
              i += 1
          i += 1
      if alltupps[-2][0] != alltupps[-1][0]:
          newlist.append(alltupps[-1])
      return dict(newlist)