code: def peak_propogation(treeg):
      treeg.ndata["pred_labels"] = (
          torch.zeros(treeg.num_nodes()).long() - 1
      )
      peaks = torch.where(treeg.in_degrees() == 0)[0].cpu().numpy()
      treeg.ndata["pred_labels"][peaks] = torch.arange(peaks.shape[0])
  
      def message_func(edges):
          return {"mlb": edges.src["pred_labels"]}
  
      def reduce_func(nodes):
          return {"pred_labels": nodes.mailbox["mlb"][:, 0]}
  
      node_order = dgl.traversal.topological_nodes_generator(treeg)
      treeg.prop_nodes(node_order, message_func, reduce_func)
      pred_labels = treeg.ndata["pred_labels"].cpu().numpy()
      return peaks, pred_labels
  
file_path: dgl/examples/pytorch/hilander/utils/deduce.py
imports: import dgl
  import numpy
  import torch
  from sklearn import mixture
  from .density import density_to_peaks, density_to_peaks_vectorize
label_desc: Use image node_id 8 for calling a global function with example usage: peak_propogation(treeg) and returns: peaks,  pred_labels, dict, dict