Debian Codegraph @

jedi/third_party/typeshed/stdlib/tracemalloc.pyi

raw symbols SCIP
1 import sys
2 from _tracemalloc import *
3 from collections.abc import Sequence
4 from typing import Any, SupportsIndex, overload
5 from typing_extensions import TypeAlias
6
7 def get_object_traceback(obj: object) -> Traceback | None: ...
8 def take_snapshot() -> Snapshot: ...
9
10 class BaseFilter:
11 inclusive: bool
12 def __init__(self, inclusive: bool) -> None: ...
13
14 class DomainFilter(BaseFilter):
15 @property
16 def domain(self) -> int: ...
17 def __init__(self, inclusive: bool, domain: int) -> None: ...
18
19 class Filter(BaseFilter):
20 domain: int | None
21 lineno: int | None
22 @property
23 def filename_pattern(self) -> str: ...
24 all_frames: bool
25 def __init__(
26 self,
27 inclusive: bool,
28 filename_pattern: str,
29 lineno: int | None = None,
30 all_frames: bool = False,
31 domain: int | None = None,
32 ) -> None: ...
33
34 class Statistic:
35 __slots__ = ("traceback", "size", "count")
36 count: int
37 size: int
38 traceback: Traceback
39 def __init__(self, traceback: Traceback, size: int, count: int) -> None: ...
40 def __eq__(self, other: object) -> bool: ...
41 def __hash__(self) -> int: ...
42
43 class StatisticDiff:
44 __slots__ = ("traceback", "size", "size_diff", "count", "count_diff")
45 count: int
46 count_diff: int
47 size: int
48 size_diff: int
49 traceback: Traceback
50 def __init__(self, traceback: Traceback, size: int, size_diff: int, count: int, count_diff: int) -> None: ...
51 def __eq__(self, other: object) -> bool: ...
52 def __hash__(self) -> int: ...
53
54 _FrameTuple: TypeAlias = tuple[str, int]
55
56 class Frame:
57 __slots__ = ("_frame",)
58 @property
59 def filename(self) -> str: ...
60 @property
61 def lineno(self) -> int: ...
62 def __init__(self, frame: _FrameTuple) -> None: ...
63 def __eq__(self, other: object) -> bool: ...
64 def __hash__(self) -> int: ...
65 def __lt__(self, other: Frame) -> bool: ...
66 if sys.version_info >= (3, 11):
67 def __gt__(self, other: Frame) -> bool: ...
68 def __ge__(self, other: Frame) -> bool: ...
69 def __le__(self, other: Frame) -> bool: ...
70 else:
71 def __gt__(self, other: Frame, NotImplemented: Any = ...) -> bool: ...
72 def __ge__(self, other: Frame, NotImplemented: Any = ...) -> bool: ...
73 def __le__(self, other: Frame, NotImplemented: Any = ...) -> bool: ...
74
75 _TraceTuple: TypeAlias = tuple[int, int, Sequence[_FrameTuple], int | None] | tuple[int, int, Sequence[_FrameTuple]]
76
77 class Trace:
78 __slots__ = ("_trace",)
79 @property
80 def domain(self) -> int: ...
81 @property
82 def size(self) -> int: ...
83 @property
84 def traceback(self) -> Traceback: ...
85 def __init__(self, trace: _TraceTuple) -> None: ...
86 def __eq__(self, other: object) -> bool: ...
87 def __hash__(self) -> int: ...
88
89 class Traceback(Sequence[Frame]):
90 __slots__ = ("_frames", "_total_nframe")
91 @property
92 def total_nframe(self) -> int | None: ...
93 def __init__(self, frames: Sequence[_FrameTuple], total_nframe: int | None = None) -> None: ...
94 def format(self, limit: int | None = None, most_recent_first: bool = False) -> list[str]: ...
95 @overload
96 def __getitem__(self, index: SupportsIndex) -> Frame: ...
97 @overload
98 def __getitem__(self, index: slice[SupportsIndex | None]) -> Sequence[Frame]: ...
99 def __contains__(self, frame: Frame) -> bool: ... # type: ignore[override]
100 def __len__(self) -> int: ...
101 def __eq__(self, other: object) -> bool: ...
102 def __hash__(self) -> int: ...
103 def __lt__(self, other: Traceback) -> bool: ...
104 if sys.version_info >= (3, 11):
105 def __gt__(self, other: Traceback) -> bool: ...
106 def __ge__(self, other: Traceback) -> bool: ...
107 def __le__(self, other: Traceback) -> bool: ...
108 else:
109 def __gt__(self, other: Traceback, NotImplemented: Any = ...) -> bool: ...
110 def __ge__(self, other: Traceback, NotImplemented: Any = ...) -> bool: ...
111 def __le__(self, other: Traceback, NotImplemented: Any = ...) -> bool: ...
112
113 class Snapshot:
114 def __init__(self, traces: Sequence[_TraceTuple], traceback_limit: int) -> None: ...
115 def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = False) -> list[StatisticDiff]: ...
116 def dump(self, filename: str) -> None: ...
117 def filter_traces(self, filters: Sequence[DomainFilter | Filter]) -> Snapshot: ...
118 @staticmethod
119 def load(filename: str) -> Snapshot: ...
120 def statistics(self, key_type: str, cumulative: bool = False) -> list[Statistic]: ...
121 traceback_limit: int
122 traces: Sequence[Trace]