massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / paramiko / paramiko / util.pyi
1 import sys
2 from logging import Logger, LogRecord
3 from types import TracebackType
4 from typing import IO, AnyStr, Callable, Protocol, Type, TypeVar
5
6 from paramiko.config import SSHConfig, SSHConfigDict
7 from paramiko.hostkeys import HostKeys
8
9 if sys.version_info >= (3, 0):
10     from hashlib import _Hash
11 else:
12     from hashlib import _hash as _Hash
13
14 class SupportsClose(Protocol):
15     def close(self) -> None: ...
16
17 _T = TypeVar("_T")
18 _TC = TypeVar("_TC", bound=SupportsClose)
19
20 def inflate_long(s: bytes, always_positive: bool = ...) -> int: ...
21
22 deflate_zero: int
23 deflate_ff: int
24
25 def deflate_long(n: int, add_sign_padding: bool = ...) -> bytes: ...
26 def format_binary(data: bytes, prefix: str = ...) -> list[str]: ...
27 def format_binary_line(data: bytes) -> str: ...
28 def safe_string(s: bytes) -> bytes: ...
29 def bit_length(n: int) -> int: ...
30 def tb_strings() -> list[str]: ...
31 def generate_key_bytes(hash_alg: Type[_Hash], salt: bytes, key: bytes | str, nbytes: int) -> bytes: ...
32 def load_host_keys(filename: str) -> HostKeys: ...
33 def parse_ssh_config(file_obj: IO[str]) -> SSHConfig: ...
34 def lookup_ssh_host_config(hostname: str, config: SSHConfig) -> SSHConfigDict: ...
35 def mod_inverse(x: int, m: int) -> int: ...
36 def get_thread_id() -> int: ...
37 def log_to_file(filename: str, level: int = ...) -> None: ...
38
39 class PFilter:
40     def filter(self, record: LogRecord) -> bool: ...
41
42 def get_logger(name: str) -> Logger: ...
43 def retry_on_signal(function: Callable[[], _T]) -> _T: ...
44 def constant_time_bytes_eq(a: AnyStr, b: AnyStr) -> bool: ...
45
46 class ClosingContextManager:
47     def __enter__(self: _TC) -> _TC: ...
48     def __exit__(
49         self, type: Type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
50     ) -> None: ...
51
52 def clamp_value(minimum: int, val: int, maximum: int) -> int: ...