code: def degree_norm(graph, mode="indegree"):
      """Calculate the degree normalization of a graph
  
      Args:
          graph: the graph object from (:code:`Graph`)
  
          mode: which degree to be normalized ("indegree" or "outdegree")
  
      return:
          A tensor with shape (num_nodes, 1).
  
      """
  
      assert mode in ["indegree", "outdegree"], (
          "The degree_norm mode should be in ['indegree', 'outdegree']. But recieve mode=%s"
          % mode
      )
  
      if mode == "indegree":
          degree = graph.indegree()
      elif mode == "outdegree":
          degree = graph.outdegree()
  
      norm = paddle.cast(degree, dtype=paddle.get_default_dtype())
      norm = paddle.clip(norm, min=1.0)
      norm = paddle.pow(norm, -0.5)
      norm = paddle.reshape(norm, [-1, 1])
      return norm
  
file_path: PGL/pgl/nn/functional/graph_op.py
imports: import paddle
  import paddle.nn
  import pgl
  import pgl.math
label_desc: Use image node_id 1 for calling a global function with example usage: degree_norm(graph, mode) and returns: norm