docs: def _group_similar(items: List[T],
                     comparer: Callable[[T, T], bool]) -> List[List[T]]:
      """Combines similar items into groups.
  
    Args:
      items: The list of items to group.
      comparer: Determines if two items are similar.
  
    Returns:
      A list of groups of items.
    """
      groups = []  # type: List[List[T]]
      used = set()  # type: Set[int]
      for i in range(len(items)):
          if i not in used:
              group = [items[i]]
              for j in range(i + 1, len(items)):
                  if j not in used and comparer(items[i], items[j]):
                      used.add(j)
                      group.append(items[j])
              groups.append(group)
      return groups