code: def calc_weight(g):
      """
      Compute row_normalized(D^(-1/2)AD^(-1/2))
      """
      with g.local_scope():
          # compute D^(-0.5)*D(-1/2), assuming A is Identity
          g.ndata["in_deg"] = g.in_degrees().float().pow(-0.5)
          g.ndata["out_deg"] = g.out_degrees().float().pow(-0.5)
          g.apply_edges(fn.u_mul_v("out_deg", "in_deg", "weight"))
          # row-normalize weight
          g.update_all(
              fn.copy_e("weight", "msg"), fn.sum("msg", "norm")
          )
          g.apply_edges(fn.e_div_v("weight", "norm", "weight"))
          return g.edata["weight"]
  
imports: import argparse
  import os
  import time
  import dgl
  import dgl.function
  import torch
  import torch.nn
  import torch.nn.functional
  from dataset import load_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: calc_weight(g) and returns: g