from celery import states as states
from celery.exceptions import TimeoutError as TimeoutError
from celery.five import items as items
from celery.result import ResultSet as ResultSet
from celery.utils.text import truncate as truncate
from typing import Any, Optional

E_STILL_WAITING: str
humanize_seconds: Any

class Sentinel(Exception): ...

class ManagerMixin:
    def remark(self, s: str, sep: str=...) -> None: ...
    def missing_results(self, r: Sequence[AsyncResult]) -> Sequence[str]: ...
    def wait_for(self, fun: Any, catch: Any, desc: str = ..., args: Any = ..., kwargs: Optional[Any] = ..., errback: Optional[Any] = ..., max_retries: int = ..., interval_start: float = ..., interval_step: float = ..., interval_max: float = ..., emit_warning: bool = ..., **options: Any): ...
    def ensure_not_for_a_while(self, fun: Any, catch: Any, desc: str = ..., max_retries: int = ..., interval_start: float = ..., interval_step: float = ..., interval_max: float = ..., emit_warning: bool = ..., **options: Any): ...
    def retry_over_time(self, *args: Any, **kwargs: Any): ...
    def join(self, r: Any, propagate: bool = ..., max_retries: int = ..., **kwargs: Any): ...
    def inspect(self, timeout: float = ...): ...
    def query_tasks(self, ids: Any, timeout: float = ...) -> None: ...
    def query_task_states(self, ids: Any, timeout: float = ...): ...
    def assert_accepted(self, ids: Any, interval: float = ..., desc: str = ..., **policy: Any): ...
    def assert_received(self, ids: Any, interval: float = ..., desc: str = ..., **policy: Any): ...
    def assert_result_tasks_in_progress_or_completed(self, async_results: Any, interval: float = ..., desc: str = ..., **policy: Any): ...
    def assert_task_state_from_result(self, fun: Any, results: Any, interval: float = ..., **policy: Any): ...
    @staticmethod
    def is_result_task_in_progress(results: Any, **kwargs: Any): ...
    def assert_task_worker_state(self, fun: Any, ids: Any, interval: float = ..., **policy: Any): ...
    def is_received(self, ids: Any, **kwargs: Any): ...
    def is_accepted(self, ids: Any, **kwargs: Any): ...
    def true_or_raise(self, fun: Any, *args: Any, **kwargs: Any): ...

class Manager(ManagerMixin):
    app: Any = ...
    def __init__(self, app: Any, **kwargs: Any) -> None: ...
