import threading
from dummy_thread import getcurrent as get_ident
from typing import Any, Optional

def default_socket_timeout(timeout: Any) -> None: ...

class bgThread(threading.Thread):
    daemon: bool = ...
    name: Any = ...
    def __init__(self, name: Optional[Any] = ..., **kwargs: Any) -> None: ...
    def body(self) -> None: ...
    def on_crash(self, msg: Any, *fmt: Any, **kwargs: Any) -> None: ...
    def run(self) -> None: ...
    def stop(self) -> None: ...

class Local:
    def __init__(self) -> None: ...
    def __iter__(self) -> Any: ...
    def __call__(self, proxy: Any): ...
    def __release_local__(self) -> None: ...
    def __getattr__(self, name: Any): ...
    def __setattr__(self, name: Any, value: Any) -> None: ...
    def __delattr__(self, name: Any) -> None: ...

class _LocalStack:
    def __init__(self) -> None: ...
    def __release_local__(self) -> None: ...
    def _get__ident_func__(self): ...
    def _set__ident_func__(self, value: Any) -> None: ...
    __ident_func__: Any = ...
    def __call__(self): ...
    def push(self, obj: Any): ...
    def pop(self): ...
    def __len__(self): ...
    @property
    def stack(self): ...
    @property
    def top(self): ...

class LocalManager:
    locals: Any = ...
    ident_func: Any = ...
    def __init__(self, locals: Optional[Any] = ..., ident_func: Optional[Any] = ...) -> None: ...
    def get_ident(self): ...
    def cleanup(self) -> None: ...

class _FastLocalStack(threading.local):
    stack: Any = ...
    push: Any = ...
    pop: Any = ...
    def __init__(self) -> None: ...
    @property
    def top(self): ...
    def __len__(self): ...

LocalStack: Any
