(self, graph: Optional[networkx.DiGraph]=None)
:param graph: A graph where nodes are definitions, and edges represent uses.
:param graph: A graph where nodes are definitions, and edges represent uses.
: param graph : A graph where nodes are definitions and edges represent uses .
def __init__(self, graph: Optional[networkx.DiGraph]=None):
        """
        :param graph: A graph where nodes are definitions, and edges represent uses.
        """
        # Used for memoization of the `transitive_closure` method.
        self._transitive_closures: Dict = {}

        if graph and not all(map(_is_definition, graph.nodes)):
            raise TypeError("In a DepGraph, nodes need to be <%s>s." % Definition.__name__)

        self._graph: networkx.DiGraph = graph if graph is not None else networkx.DiGraph()
def __init__ ( self , graph : Optional [ networkx . DiGraph ] = None ) : # Used for memoization of the `transitive_closure` method. self . _transitive_closures : Dict = { } if graph and not all ( map ( _is_definition , graph . nodes ) ) : raise TypeError ( "In a DepGraph, nodes need to be <%s>s." % Definition . __name__ ) self . _graph : networkx . DiGraph = graph if graph is not None else networkx . DiGraph ( )