def METHOD_NAME(
    key: Callable[[T], Any], inc: int, heap: list[tuple[Any, int, T]]
) -> HeapSet[T]:
    self = object.__new__(HeapSet)
    self.key = key
    self._data = {v for _, _, v in heap}
    self._inc = inc
    self._heap = [(k, i, weakref.ref(v)) for k, i, v in heap]
    heapq.heapify(self._heap)
    self._sorted = not heap
    return self