code: def test_prop_nodes_topo(idtype):
      # bi-directional chain
      g = create_graph(idtype)
      assert check_fail(dgl.prop_nodes_topo, g)  # has loop
  
      # tree
      tree = dgl.graph([])
      tree.add_nodes(5)
      tree.add_edges(1, 0)
      tree.add_edges(2, 0)
      tree.add_edges(3, 2)
      tree.add_edges(4, 2)
      tree = dgl.graph(tree.edges())
      # init node feature data
      tree.ndata["x"] = F.zeros((5, 2))
      # set all leaf nodes to be ones
      tree.nodes[[1, 3, 4]].data["x"] = F.ones((3, 2))
      dgl.prop_nodes_topo(
          tree,
          message_func=mfunc,
          reduce_func=rfunc,
          apply_node_func=None,
      )
      # root node get the sum
      assert F.allclose(tree.nodes[0].data["x"], F.tensor([[3.0, 3.0]]))
  
file_path: dgl/tests/python/common/test_propagate.py
imports: import unittest
  import backend
  import dgl
  import networkx
  from utils import check_fail, parametrize_idtype
label_desc: Use image node_id 6 for calling a global function with example usage: test_prop_nodes_topo(idtype) without return types