-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.pyi
173 lines (154 loc) · 5.34 KB
/
__init__.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# pylint: skip-file
__all__: Final[list[str]] = [
"BinarySearchTree",
"BinaryTree",
"ComparableContent",
"ComparableContentT",
"Edge",
"Graph",
"List",
"Queue",
"Stack",
"Vertex",
]
from typing import Final, Generic, TypeVar, overload
from nrw.datastructures._comparable_content import ComparableContent, ComparableContentT
_T = TypeVar("_T")
class Queue(Generic[_T]):
__slots__: Final[tuple[str, str]] = ("_head", "_tail")
__hash__ = None # type: ignore[assignment]
def __init__(self) -> None: ...
@property
def is_empty(self) -> bool: ...
def enqueue(self, content: _T) -> None: ...
def dequeue(self) -> None: ...
@property
def front(self) -> _T | None: ...
class Stack(Generic[_T]):
__slots__: Final[tuple[str]] = ("_head",)
__hash__ = None # type: ignore[assignment]
def __init__(self) -> None: ...
@property
def is_empty(self) -> bool: ...
def push(self, content: _T) -> None: ...
def pop(self) -> None: ...
@property
def top(self) -> _T | None: ...
class List(Generic[_T]):
__slots__: Final[tuple[str, str, str]] = ("_current", "_first", "_last")
__hash__ = None # type: ignore[assignment]
def __init__(self) -> None: ...
@property
def is_empty(self) -> bool: ...
@property
def has_access(self) -> bool: ...
def next(self) -> None: ...
def to_first(self) -> None: ...
def to_last(self) -> None: ...
@property
def content(self) -> _T | None: ...
@content.setter
def content(self, new_content: _T | None) -> None: ...
def insert(self, content: _T | None) -> None: ...
def append(self, content: _T | None) -> None: ...
def concat(self, other_list: List[_T] | None) -> None: ...
def remove(self) -> None: ...
class BinaryTree(Generic[_T]):
__slots__: Final[tuple[str]] = ("_node",)
__hash__ = None # type: ignore[assignment]
@overload
def __init__(self) -> None: ...
@overload
def __init__(
self,
content: _T | None,
) -> None: ...
@overload
def __init__(
self,
content: _T | None,
left_tree: BinaryTree[_T] | None,
right_tree: BinaryTree[_T] | None,
) -> None: ...
@property
def is_empty(self) -> bool: ...
@property
def content(self) -> _T | None: ...
@content.setter
def content(self, new_content: _T | None) -> None: ...
@property
def left_tree(self) -> BinaryTree[_T] | None: ...
@left_tree.setter
def left_tree(self, new_tree: BinaryTree[_T] | None) -> None: ...
@property
def right_tree(self) -> BinaryTree[_T] | None: ...
@right_tree.setter
def right_tree(self, new_tree: BinaryTree[_T] | None) -> None: ...
class BinarySearchTree(Generic[ComparableContentT]):
__slots__: Final[tuple[str]] = ("_node",)
__hash__ = None # type: ignore[assignment]
def __init__(self) -> None: ...
@property
def is_empty(self) -> bool: ...
@property
def content(self) -> ComparableContentT | None: ...
@property
def left_tree(self) -> BinarySearchTree[ComparableContentT] | None: ...
@property
def right_tree(self) -> BinarySearchTree[ComparableContentT] | None: ...
def insert(self, content: ComparableContentT | None) -> None: ...
def remove(self, content: ComparableContentT | None) -> None: ...
def search(
self,
content: ComparableContentT | None,
) -> ComparableContentT | None: ...
class Vertex:
__slots__: Final[tuple[str, str]] = ("_id", "_mark")
__hash__ = None # type: ignore[assignment]
def __init__(self, id_: str) -> None: ...
@property
def id(self) -> str: ...
@property
def mark(self) -> bool: ...
@mark.setter
def mark(self, new_mark: bool) -> None: ...
@property
def is_marked(self) -> bool: ...
class Edge:
__slots__: Final[tuple[str, str, str]] = ("_mark", "_vertices", "_weight")
__hash__ = None # type: ignore[assignment]
def __init__(self, vertex: Vertex, another_vertex: Vertex, weight: int) -> None: ...
@property
def vertices(self) -> tuple[Vertex, Vertex]: ...
@property
def weight(self) -> int: ...
@weight.setter
def weight(self, new_weight: int) -> None: ...
@property
def mark(self) -> bool: ...
@mark.setter
def mark(self, new_mark: bool) -> None: ...
@property
def is_marked(self) -> bool: ...
class Graph:
__slots__: Final[tuple[str, str]] = ("_edges", "_vertices")
__hash__ = None # type: ignore[assignment]
def __init__(self) -> None: ...
@property
def vertices(self) -> List[Vertex]: ...
@property
def edges(self) -> List[Edge]: ...
def get_vertex(self, id_: str) -> Vertex | None: ...
def add_vertex(self, vertex: Vertex | None) -> None: ...
def remove_vertex(self, vertex: Vertex) -> None: ...
def get_edge(self, vertex: Vertex, another_vertex: Vertex) -> Edge | None: ...
def add_edge(self, edge: Edge | None) -> None: ...
def remove_edge(self, edge: Edge) -> None: ...
def set_all_vertex_marks(self, mark: bool) -> None: ...
def all_vertices_marked(self) -> bool: ...
def set_all_edge_marks(self, mark: bool) -> None: ...
def all_edges_marked(self) -> bool: ...
def get_neighbours(self, vertex: Vertex) -> List[Vertex]: ...
def get_edges(self, vertex: Vertex) -> List[Edge]: ...
@property
def is_empty(self) -> bool: ...