code: def add_self_loop(graph):
      """add_self_loop"""
      self_loop_edges = np.zeros((graph.num_nodes, 2))
      self_loop_edges[:, 0] = self_loop_edges[:, 1] = np.arange(
          graph.num_nodes
      )
      edges = np.vstack((graph.edges, self_loop_edges))
      edges = np.unique(edges, axis=0)
      #     print(edges.shape)
      g = pgl.graph.Graph(num_nodes=graph.num_nodes, edges=edges)
  
      for k, v in graph._node_feat.items():
          g._node_feat[k] = v
      return g
  
imports: import numpy
  import pgl
  import paddle.fluid
label_desc: Use image node_id 2 for calling a global function with example usage: add_self_loop(graph) and returns: g