code: def reduce_func(self, nodes):
      # reduce UDF for equation (3) & (4)
      # equation (3)
      alpha = F.softmax(nodes.mailbox["e"], dim=1)
      # equation (4)
      h = torch.sum(alpha * nodes.mailbox["z"], dim=1)
      return {"h": h}
  
imports: import os
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn.pytorch import GATConv
  import networkx
  from dgl import DGLGraph
  from dgl.data import citation_graph
  import time
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: reduce_func(nodes) and returns: dict