step_tree.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:guacml 作者: guacml 项目源码 文件源码
def to_pydot(self):
        """Return a pydot digraph from a StepTree."""

        graph = pydot.Dot(graph_type='digraph')

        # make sure Root shows up in single node trees
        if self.root_name:
            graph.add_node(pydot.Node(self._step_graph_label(self.root_name)))

        for parent, children in self.children.items():
            for child in children:
                graph.add_edge(pydot.Edge(
                    self._step_graph_label(parent),
                    self._step_graph_label(child)
                    ))

        return graph
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号