code: def net2graph(net_sm):
      """Transform the network to DGL graph
  
      Return
      ------
      G DGLGraph : graph by DGL
      """
      start = time.time()
      G = dgl.DGLGraph(net_sm)
      end = time.time()
      t = end - start
      print("Building DGLGraph in %.2fs" % t)
      return G
  
imports: import os
  import pickle
  import random
  import time
  import dgl
  import numpy
  import scipy.sparse
  import torch
  from dgl.data.utils import _get_dgl_url, download, extract_archive, get_download_dir
  from torch.utils.data import DataLoader
label_desc: Use image node_id 2 for calling a global function with example usage: net2graph(net_sm) and returns: G