(
        self, node: UniqueId, max_depth: Optional[int] = None
    )
return anc - {node}
Returns all nodes having a path to `node` in `graph`
Returns all nodes having a path to `node` in `graph`
Returns all nodes having a path to node in graph
def ancestors(
        self, node: UniqueId, max_depth: Optional[int] = None
    ) -> Set[UniqueId]:
        """Returns all nodes having a path to `node` in `graph`"""
        if not self.graph.has_node(node):
            raise InternalException(f'Node {node} not found in the graph!')
        with nx.utils.reversed(self.graph):
            anc = nx.single_source_shortest_path_length(G=self.graph,
                                                        source=node,
                                                        cutoff=max_depth)\
                .keys()
        return anc - {node}
def ancestors ( self , node : UniqueId , max_depth : Optional [ int ] = None ) -> Set [ UniqueId ] : if not self . graph . has_node ( node ) : raise InternalException ( f'Node {node} not found in the graph!' ) with nx . utils . reversed ( self . graph ) : anc = nx . single_source_shortest_path_length ( G = self . graph , source = node , cutoff = max_depth ) . keys ( ) return anc - { node }