code: def prepare_dgl_graph_data(args):
      data = load_data(args)
      features = torch.FloatTensor(data.features)
      labels = torch.LongTensor(data.labels)
      if hasattr(torch, "BoolTensor"):
          train_mask = torch.BoolTensor(data.train_mask)
          val_mask = torch.BoolTensor(data.val_mask)
          test_mask = torch.BoolTensor(data.test_mask)
      else:
          train_mask = torch.ByteTensor(data.train_mask)
          val_mask = torch.ByteTensor(data.val_mask)
          test_mask = torch.ByteTensor(data.test_mask)
  
      num_feats = features.shape[1]
      n_classes = data.num_labels
      n_edges = data.graph.number_of_edges()
      print(
          """----Data statistics------'
        #Edges %d
        #Classes %d
        #Train samples %d
        #Val samples %d
        #Test samples %d"""
          % (
              n_edges,
              n_classes,
              train_mask.int().sum().item(),
              val_mask.int().sum().item(),
              test_mask.int().sum().item(),
          )
      )
  
      g = data.graph
      # add self loop
      g.remove_edges_from(nx.selfloop_edges(g))
      g = DGLGraph(g)
      g.add_edges(g.nodes(), g.nodes())
      n_edges = g.number_of_edges()
  
      data = {
          "features": features,
          "graph": g,
          "train_mask": train_mask,
          "val_mask": val_mask,
          "test_mask": test_mask,
          "labels": labels,
          "num_feats": num_feats,
          "n_classes": n_classes,
          "n_edges": n_edges,
      }
  
      return data
  
imports: import argparse
  import os
  import time
  import dgl
  import dgl.function
  import networkx
  import numpy
  import torch
  import torch.backends.cudnn
  import torch.nn
  import torch.nn.functional
  from dgl import DGLGraph
  from dgl.data import load_data, register_data_args
  from scipy import sparse
  from ...modules.graph_construction import NodeEmbeddingBasedGraphConstruction, NodeEmbeddingBasedRefinedGraphConstruction
  from ...modules.utils.vocab_utils import VocabModel
  from ..utils import EarlyStopping
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_dgl_graph_data(args) and returns: data