docs: def _group_dict_set(iterator):
      """Make a dict that accumulates the values for each key in an iterator of doubles.
  
      :param iter[tuple[A,B]] iterator: An iterator
      :rtype: dict[A,set[B]]
      """
      d = defaultdict(set)
      for key, value in iterator:
          d[key].add(value)
      return dict(d)