1 from _typeshed import SupportsLenAndGetItem
2 from typing import overload
3 from typing_extensions import Literal
5 _Vector = SupportsLenAndGetItem[float]
9 def __init__(self, f: int, metric: Literal["angular", "euclidean", "manhattan", "hamming", "dot"]) -> None: ...
10 def load(self, fn: str, prefault: bool = ...) -> Literal[True]: ...
11 def save(self, fn: str, prefault: bool = ...) -> Literal[True]: ...
13 def get_nns_by_item(self, i: int, n: int, search_k: int = ..., include_distances: Literal[False] = ...) -> list[int]: ...
16 self, i: int, n: int, search_k: int, include_distances: Literal[True]
17 ) -> tuple[list[int], list[float]]: ...
20 self, i: int, n: int, search_k: int = ..., *, include_distances: Literal[True]
21 ) -> tuple[list[int], list[float]]: ...
23 def get_nns_by_vector(
24 self, vector: _Vector, n: int, search_k: int = ..., include_distances: Literal[False] = ...
27 def get_nns_by_vector(
28 self, vector: _Vector, n: int, search_k: int, include_distances: Literal[True]
29 ) -> tuple[list[int], list[float]]: ...
31 def get_nns_by_vector(
32 self, vector: _Vector, n: int, search_k: int = ..., *, include_distances: Literal[True]
33 ) -> tuple[list[int], list[float]]: ...
34 def get_item_vector(self, __i: int) -> list[float]: ...
35 def add_item(self, i: int, vector: _Vector) -> None: ...
36 def on_disk_build(self, fn: str) -> Literal[True]: ...
37 def build(self, n_trees: int, n_jobs: int = ...) -> Literal[True]: ...
38 def unbuild(self) -> Literal[True]: ...
39 def unload(self) -> Literal[True]: ...
40 def get_distance(self, __i: int, __j: int) -> float: ...
41 def get_n_items(self) -> int: ...
42 def get_n_trees(self) -> int: ...
43 def verbose(self, __v: bool) -> Literal[True]: ...
44 def set_seed(self, __s: int) -> None: ...