import abc
import typing
from . import ztyping as ztyping
from .container import convert_to_container as convert_to_container
from _typeshed import Incomplete
from abc import abstractmethod
from collections.abc import Iterable

class ZfitGraphCachable(metaclass=abc.ABCMeta):
    @abstractmethod
    def register_cacher(self, cacher: ZfitGraphCachable): ...
    @abstractmethod
    def add_cache_deps(self, cache_dependents, allow_non_cachable): ...
    @abstractmethod
    def reset_cache_self(self): ...
    @abstractmethod
    def reset_cache(self, reseter): ...

class GraphCachable(ZfitGraphCachable):
    graph_caching_methods: typing.ClassVar
    instances: Incomplete
    def __init__(self, *args, **kwargs) -> None: ...
    def __init_subclass__(cls) -> None: ...
    def register_cacher(self, cacher: ztyping.CacherOrCachersType): ...
    def add_cache_deps(self, cache_deps: ztyping.CacherOrCachersType, allow_non_cachable: bool = True): ...
    def reset_cache_self(self) -> None: ...
    def reset_cache(self, reseter: ZfitGraphCachable): ...

def invalidate_graph(func): ...

class FunctionCacheHolder(GraphCachable):
    IS_TENSOR: Incomplete
    do_jit: Incomplete
    deleter: Incomplete
    delete_from_cache: bool
    stateless_args: Incomplete
    python_func: Incomplete
    immutable_representation: Incomplete
    is_valid: bool
    def __init__(self, func, wrapped_func, cachables: ZfitGraphCachable | object | Iterable[ZfitGraphCachable] = None, cachables_mapping=None, stateless_args: bool | None = None, deleter=None, keepalive=None, do_jit=None) -> None: ...
    @property
    def wrapped_func(self): ...
    @property
    def execute_func(self): ...
    def reset_cache_self(self) -> None: ...
    def create_immutable(self, args, kwargs): ...
    def get_immutable_repr_obj(self, obj): ...
    def __hash__(self) -> int: ...
    def __eq__(self, other: object) -> bool: ...

def clear_graph_cache(*, call_gc=None) -> None: ...
