code: def level_order(forest, roots):
      forest = tocpu(forest)
      edges = bfs_edges_generator(forest, roots)
      if len(edges) == 0:
          # no edges in the tree; do not perform loopy BP
          return
      _, leaves = forest.find_edges(edges[-1])
      edges_back = bfs_edges_generator(forest, roots, reverse=True)
      yield from reversed(edges_back)
      yield from edges
  
file_path: dgl/examples/pytorch/jtnn/jtnn/jtnn_enc.py
imports: import dgl.function
  import numpy
  import torch
  import torch.nn
  from dgl import batch, bfs_edges_generator, line_graph
  from .nnutils import cuda, GRUUpdate, tocpu
label_desc: Use image node_id 1 for calling a global function with example usage: level_order(forest, roots) without return types