"""Type stubs for networkxr.multigraph."""

from typing import Any, Iterator

from networkxr.classes.views import MultiEdgeView, NodeView

class MultiGraph:
    """Undirected multigraph allowing parallel edges."""

    graph: dict[str, Any]
    _node: dict[Any, dict[str, Any]]
    _adj: dict[Any, dict[Any, dict[Any, dict[str, Any]]]]

    def __init__(self, incoming_graph_data: Any = None, **attr: Any) -> None: ...
    def is_multigraph(self) -> bool: ...
    def is_directed(self) -> bool: ...
    def add_node(self, n: Any, **attr: Any) -> None: ...
    def add_nodes_from(self, nodes: Any, **attr: Any) -> None: ...
    def remove_node(self, n: Any) -> None: ...
    def add_edge(self, u: Any, v: Any, key: Any = None, **attr: Any) -> Any: ...
    def add_edges_from(self, ebunch: Any, **attr: Any) -> None: ...
    def add_weighted_edges_from(self, ebunch: Any, weight: str = "weight") -> None: ...
    def remove_edge(self, u: Any, v: Any, key: Any = None) -> None: ...
    def has_node(self, n: Any) -> bool: ...
    def has_edge(self, u: Any, v: Any, key: Any = None) -> bool: ...
    @property
    def nodes(self) -> NodeView: ...
    @property
    def edges(self) -> MultiEdgeView: ...
    def degree(self, nbunch: Any = None) -> Any: ...
    def neighbors(self, n: Any) -> Iterator[Any]: ...
    def number_of_nodes(self) -> int: ...
    def number_of_edges(self) -> int: ...
    def copy(self) -> MultiGraph: ...
    def clear(self) -> None: ...
    def get_edge_data(self, u: Any, v: Any, key: Any = None, default: Any = None) -> Any: ...
    @property
    def name(self) -> str: ...
    @name.setter
    def name(self, val: str) -> None: ...
    @property
    def adj(self) -> dict[Any, dict[Any, dict[Any, dict[str, Any]]]]: ...
    def to_undirected(self) -> MultiGraph: ...
    def subgraph(self, nodes: Any) -> MultiGraph: ...
    def __contains__(self, n: Any) -> bool: ...
    def __len__(self) -> int: ...
    def __iter__(self) -> Iterator[Any]: ...
    def __getitem__(self, n: Any) -> dict[Any, dict[Any, dict[str, Any]]]: ...

class MultiDiGraph:
    """Directed multigraph allowing parallel edges."""

    graph: dict[str, Any]
    _node: dict[Any, dict[str, Any]]
    _adj: dict[Any, dict[Any, dict[Any, dict[str, Any]]]]
    _pred: dict[Any, dict[Any, dict[Any, dict[str, Any]]]]

    def __init__(self, incoming_graph_data: Any = None, **attr: Any) -> None: ...
    def is_multigraph(self) -> bool: ...
    def is_directed(self) -> bool: ...
    def add_node(self, n: Any, **attr: Any) -> None: ...
    def add_nodes_from(self, nodes: Any, **attr: Any) -> None: ...
    def remove_node(self, n: Any) -> None: ...
    def add_edge(self, u: Any, v: Any, key: Any = None, **attr: Any) -> Any: ...
    def add_edges_from(self, ebunch: Any, **attr: Any) -> None: ...
    def add_weighted_edges_from(self, ebunch: Any, weight: str = "weight") -> None: ...
    def remove_edge(self, u: Any, v: Any, key: Any = None) -> None: ...
    def has_node(self, n: Any) -> bool: ...
    def has_edge(self, u: Any, v: Any, key: Any = None) -> bool: ...
    @property
    def nodes(self) -> NodeView: ...
    @property
    def edges(self) -> MultiEdgeView: ...
    def degree(self, nbunch: Any = None) -> Any: ...
    def in_degree(self, nbunch: Any = None) -> Any: ...
    def out_degree(self, nbunch: Any = None) -> Any: ...
    def successors(self, n: Any) -> Iterator[Any]: ...
    def predecessors(self, n: Any) -> Iterator[Any]: ...
    def neighbors(self, n: Any) -> Iterator[Any]: ...
    def number_of_nodes(self) -> int: ...
    def number_of_edges(self) -> int: ...
    def copy(self) -> MultiDiGraph: ...
    def clear(self) -> None: ...
    def get_edge_data(self, u: Any, v: Any, key: Any = None, default: Any = None) -> Any: ...
    @property
    def name(self) -> str: ...
    @name.setter
    def name(self, val: str) -> None: ...
    @property
    def adj(self) -> dict[Any, dict[Any, dict[Any, dict[str, Any]]]]: ...
    def reverse(self, copy: bool = True) -> MultiDiGraph: ...
    def to_undirected(self) -> MultiGraph: ...
    def __contains__(self, n: Any) -> bool: ...
    def __len__(self) -> int: ...
    def __iter__(self) -> Iterator[Any]: ...
    def __getitem__(self, n: Any) -> dict[Any, dict[Any, dict[str, Any]]]: ...
