from typing import Iterable, Iterator, Tuple, Generator

class Heap:
    def __init__(self, size_of_heap: int) -> None: ...
    def build_heap(self, array: Iterable[Tuple[float, int]]) -> "Heap": ...
    def __iter__(self) -> Iterator[Tuple[float, int]]: ...
    def push(self, value: float, offset: int) -> None: ...
    def pop(self) -> tuple[float, int]: ...
    def heappushpop(self, value: float, offset: int) -> tuple[float, int]: ...
    def get_n_largest(
        self, k: int, restore: bool = ...
    ) -> Iterator[tuple[float, int]]: ...
    def __len__(self) -> int: ...
    def nbytes_capacity(self) -> int: ...
    def nbytes_used(self) -> int: ...
    def __sizeof__(self) -> int: ...

def heappush(heap: Heap, value: float, offset: int) -> None: ...
def heappop(heap: Heap) -> tuple[float, int]: ...
def heappushpop(heap: Heap, value: float, offset: int) -> tuple[float, int]: ...
def heappeek(heap: Heap, k: int) -> tuple[float, int]: ...
def nlargest(heap: Heap, k: int) -> Iterable[tuple[float, int]]: ...
def string_generator(
    file_name: str, offset_lis: Iterable[int] | Iterable[tuple[float, int]]
) -> Generator[str]: ...
def string_float_generator(
    file_name: str, offset_lis: Iterable[int] | Iterable[tuple[float, int]]
) -> Generator[str, float]: ...
def string_getter(file_name: str, offset: int) -> str: ...
