2 from _typeshed import Self, StrOrBytesPath
3 from types import CodeType
4 from typing import Any, Callable, Tuple, TypeVar
6 def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ...
8 statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = ..., sort: str | int = ...
12 _Label = Tuple[str, int, str]
15 stats: dict[_Label, tuple[int, int, int, int, dict[_Label, tuple[int, int, int, int]]]] # undocumented
17 self, timer: Callable[[], float] = ..., timeunit: float = ..., subcalls: bool = ..., builtins: bool = ...
19 def enable(self) -> None: ...
20 def disable(self) -> None: ...
21 def print_stats(self, sort: str | int = ...) -> None: ...
22 def dump_stats(self, file: StrOrBytesPath) -> None: ...
23 def create_stats(self) -> None: ...
24 def snapshot_stats(self) -> None: ...
25 def run(self: Self, cmd: str) -> Self: ...
26 def runctx(self: Self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ...
27 def runcall(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
28 if sys.version_info >= (3, 8):
29 def __enter__(self: Self) -> Self: ...
30 def __exit__(self, *exc_info: Any) -> None: ...
32 def label(code: str | CodeType) -> _Label: ... # undocumented