massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / humanfriendly / humanfriendly / __init__.pyi
1 import datetime
2 from typing import Any, NamedTuple, Pattern
3
4 class SizeUnit(NamedTuple):
5     divider: int
6     symbol: str
7     name: str
8
9 class CombinedUnit(NamedTuple):
10     decimal: SizeUnit
11     binary: SizeUnit
12
13 disk_size_units: Any
14 length_size_units: Any
15 time_units: Any
16
17 def coerce_boolean(value: object) -> bool: ...
18 def coerce_pattern(value: str | Pattern[str], flags: int = ...) -> Pattern[str]: ...
19 def coerce_seconds(value: float | datetime.timedelta) -> float: ...
20 def format_size(num_bytes: float, keep_width: bool = ..., binary: bool = ...) -> str: ...
21 def parse_size(size: str, binary: bool = ...) -> int: ...
22 def format_length(num_metres: float, keep_width: bool = ...) -> str: ...
23 def parse_length(length: str) -> float: ...
24 def format_number(number: float, num_decimals: int = ...) -> str: ...
25 def round_number(count: float, keep_width: bool = ...) -> str: ...
26 def format_timespan(num_seconds: float | datetime.timedelta, detailed: bool = ..., max_units: int = ...) -> str: ...
27 def parse_timespan(timespan: str) -> float: ...
28 def parse_date(datestring: str) -> tuple[int, int, int, int, int, int]: ...
29 def format_path(pathname: str) -> str: ...
30 def parse_path(pathname: str) -> str: ...
31
32 class Timer:
33     monotonic: bool
34     resumable: bool
35     start_time: float
36     total_time: float
37     def __init__(self, start_time: Any | None = ..., resumable: bool = ...) -> None: ...
38     def __enter__(self): ...
39     def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ...
40     def sleep(self, seconds: float) -> None: ...
41     @property
42     def elapsed_time(self): ...
43     @property
44     def rounded(self): ...
45
46 class InvalidDate(Exception): ...
47 class InvalidSize(Exception): ...
48 class InvalidLength(Exception): ...
49 class InvalidTimespan(Exception): ...