from collections.abc import Iterable, Iterator
from typing import Any

class CyclicDependencyError(ValueError): ...

def topological_sort_as_sets(dependency_graph: dict[Any, Any]) -> Iterator[set[Any]]: ...
def stable_topological_sort(nodes: Iterable[Any], dependency_graph: dict[Any, Any]) -> list[Any]: ...
