original_docstring: 
      Convert a tree to a graph.
      
docstring: Convert a tree to a graph.
docstring_tokens: Convert a tree to a graph .
code: def tree_to_graph(tree: ModuleTree) -> DiGraph:
      """
      Convert a tree to a graph.
      """
      graph = DiGraph()
  
      for node_id, node in tree.nodes.items():
          graph.add_node(node_id)
          for child_id in node.children:
              graph.add_edge(node_id, child_id)
          for parent_id in node.parents:
              graph.add_edge(parent_id, node_id)
      return graph
code_tokens: def tree_to_graph ( tree : ModuleTree ) -> DiGraph : graph = DiGraph ( ) for node_id , node in tree . nodes . items ( ) : graph . add_node ( node_id ) for child_id in node . children : graph . add_edge ( node_id , child_id ) for parent_id in node . parents : graph . add_edge ( parent_id , node_id ) return graph
short_docstring: Convert a tree to a graph.
short_docstring_tokens: Convert a tree to a graph .
comment: """
      Convert a tree to a graph.
      """