def get_subgraph_for_node(node_name):
"""
Prints the dependency graph for only the specified node_name (a full dependency
graph can be difficult to read).
:param node_name: Node for which to print the sub-graph
:return:
"""
ancestors = nx.ancestors(G, node_name)
ancestors.add(node_name)
return nx.subgraph(G, ancestors)
评论列表
文章目录