from __future__ import annotations

from typing import Any, Optional

class Role:
    WORKER: int = ...
    SERVER: int = ...
    HETER_WORKER: int = ...
    ALL: int = ...

class Gloo:
    class RENDEZVOUS:
        HDFS: int = ...
        FILE: int = ...
        HTTP: int = ...
    def __init__(self) -> None: ...
    def init(
        self,
        rendezvous: Any,
        role: Any,
        role_id: Any,
        worker_num: Any,
        server_num: Any,
        need_init_all: bool = ...,
        kwargs: Optional[Any] = ...,
    ) -> None: ...
    def barrier(self, comm_world: Any) -> None: ...
    def all_reduce(self, input: Any, mode: str = ..., comm_world: str = ...): ...
    def all_gather(self, input: Any, comm_world: str = ...): ...

class RoleMakerBase:
    def __init__(self) -> None: ...
    def to_string(self): ...

class PaddleCloudRoleMaker(RoleMakerBase):
    def __init__(self, is_collective: bool = ..., **kwargs: Any) -> None: ...

class UserDefinedRoleMaker(PaddleCloudRoleMaker):
    def __init__(self, is_collective: bool = ..., init_gloo: bool = ..., **kwargs: Any) -> None: ...
