2 from typing import Any, NamedTuple, Pattern
4 class SizeUnit(NamedTuple):
9 class CombinedUnit(NamedTuple):
14 length_size_units: Any
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: ...
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: ...
42 def elapsed_time(self): ...
44 def rounded(self): ...
46 class InvalidDate(Exception): ...
47 class InvalidSize(Exception): ...
48 class InvalidLength(Exception): ...
49 class InvalidTimespan(Exception): ...