code: def add_self_loop_for_subgraph(graph):
      """add_self_loop_for_subgraph"""
      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)
      g = pgl.graph.SubGraph(
          num_nodes=graph.num_nodes,
          edges=edges,
          reindex=graph._from_reindex,
      )
      for k, v in graph._node_feat.items():
          g._node_feat[k] = v
      return graph
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from __future__ import absolute_import
  from dataloader.base_dataloader import BaseDataGenerator
  from pgl.contrib.ogb.nodeproppred.dataset_pgl import PglNodePropPredDataset
  import tqdm
  from collections import namedtuple
  import pgl
  import numpy
  import copy
label_desc: Use image node_id 1 for calling a global function with example usage: add_self_loop_for_subgraph(graph) and returns: graph