from __future__ import annotations

from typing import Any

logger: Any
formatter: Any
ch: Any
ELASTIC_EXIT_CODE: int
ELASTIC_AUTO_PARALLEL_EXIT_CODE: int
ELASTIC_TIMEOUT: Any
ELASTIC_TTL: int

class ElasticLevel:
    FAULT_TOLERANCE: int = ...
    ELASTIC: int = ...

class ElasticStatus:
    COMPLETED: str = ...
    ERROR: str = ...
    HOLD: str = ...
    RESTART: str = ...
    EXIT: str = ...

class LauncherInterface:
    args: Any = ...
    procs: Any = ...
    def __init__(self, args: Any) -> None: ...
    def launch(self) -> None: ...
    def stop(self) -> None: ...
    def watch(self) -> None: ...

class ElasticManager:
    args: Any = ...
    host: Any = ...
    elastic_timeout: Any = ...
    start_port: Any = ...
    trainers: Any = ...
    np: Any = ...
    dist_endpoints: Any = ...
    trainer_endpoints_list: Any = ...
    curr_host: Any = ...
    elastic_level: Any = ...
    hosts: Any = ...
    stopped: bool = ...
    sigint: int = ...
    need_sync: bool = ...
    elastic_startup_time: Any = ...
    enable: bool = ...
    etcd: Any = ...
    prefix: Any = ...
    node_prefix: Any = ...
    np_path: Any = ...
    endpoints_path: Any = ...
    host_path: Any = ...
    watches: Any = ...
    launcher: Any = ...
    def __init__(self, args: Any, etcd_client: Any) -> None: ...
    def exit(self, completed: bool = ...) -> None: ...
    def pre_hook(self) -> None: ...
    def wait(self) -> None: ...
    def run(self, launcher: Any) -> None: ...
    def watch(self): ...
    def signal_handler(self, sigint: Any, frame: Any) -> None: ...
