code: def dfs_order(forest, roots):
      forest = tocpu(forest)
      edges = dfs_labeled_edges_generator(
          forest, roots, has_reverse_edge=True
      )
      for e, l in zip(*edges):
          # I exploited the fact that the reverse edge ID equal to 1 xor forward
          # edge ID for molecule trees.  Normally, I should locate reverse edges
          # using find_edges().
          yield e ^ l, l
  
file_path: dgl/examples/pytorch/jtnn/jtnn/jtnn_dec.py
imports: import dgl.function
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl import batch, dfs_labeled_edges_generator, line_graph
  from .chemutils import enum_assemble_nx, get_mol
  from .mol_tree_nx import DGLMolTree
  from .nnutils import cuda, GRUUpdate, tocpu
label_desc: Use image node_id 1 for calling a global function with example usage: dfs_order(forest, roots) without return types