code: def load_ogb(name, root="dataset"):
      if name == "ogbn-mag240M":
          return load_mag240m(root)
  
      from ogb.nodeproppred import DglNodePropPredDataset
  
      print("load", name)
      data = DglNodePropPredDataset(name=name, root=root)
      print("finish loading", name)
      splitted_idx = data.get_idx_split()
      graph, labels = data[0]
      labels = labels[:, 0]
  
      graph.ndata["features"] = graph.ndata.pop("feat")
      num_labels = len(
          th.unique(labels[th.logical_not(th.isnan(labels))])
      )
      graph.ndata["labels"] = labels.type(th.LongTensor)
      in_feats = graph.ndata["features"].shape[1]
  
      # Find the node IDs in the training, validation, and test set.
      train_nid, val_nid, test_nid = (
          splitted_idx["train"],
          splitted_idx["valid"],
          splitted_idx["test"],
      )
      train_mask = th.zeros((graph.number_of_nodes(),), dtype=th.bool)
      train_mask[train_nid] = True
      val_mask = th.zeros((graph.number_of_nodes(),), dtype=th.bool)
      val_mask[val_nid] = True
      test_mask = th.zeros((graph.number_of_nodes(),), dtype=th.bool)
      test_mask[test_nid] = True
      graph.ndata["train_mask"] = train_mask
      graph.ndata["val_mask"] = val_mask
      graph.ndata["test_mask"] = test_mask
      print("finish constructing", name)
      return graph, num_labels
  
file_path: dgl/examples/pytorch/labor/load_graph.py
imports: import dgl
  import torch
label_desc: Use image node_id 5 for calling a global function with example usage: load_ogb(name, root) and returns: graph,  num_labels, load_mag240m