from types import ModuleType
from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Type, TypeVar, Union

def is_registered(obj: Any) -> bool: ...
def unregister_ops(*objs: Any) -> None: ...
def clear_registry() -> None: ...
def operation(obj: Union[Callable, type]) -> Union[Callable, type]: ...
def register_ops(
    *objs: Union[Callable, type, ModuleType, str, Iterable[Any]],
    recurse_packages: bool = ...,
    public_only: bool = ...,
    only_defined_in_owner: bool = ...,
    include_callables_with_dunder_call: bool = ...,
    include: Optional[Iterable[str]] = ...,
    exclude: Optional[Iterable[str]] = ...,
    predicate: Optional[Callable[[str, Any], bool]] = ...
) -> None: ...

class _PatchSession: ...
def begin_capture() -> _PatchSession: ...
def end_capture(sess: _PatchSession) -> None: ...

def alias_root(name: str) -> Any: ...

T = TypeVar("T")
def typed_alias(name: str, typ: Type[T]) -> T: ...
