code: def pre_process(self):
      processed_dir = osp.join(self.root, "processed")
      pre_processed_file_path = osp.join(
          processed_dir, "data_processed"
      )
  
      if osp.exists(pre_processed_file_path):
          loaded_dict = torch.load(pre_processed_file_path)
          self.graph, self.labels = (
              loaded_dict["graph"],
              loaded_dict["labels"],
          )
  
      else:
          ### check download
          if self.binary:
              # npz format
              has_necessary_file_simple = osp.exists(
                  osp.join(self.root, "raw", "data.npz")
              ) and (not self.is_hetero)
              has_necessary_file_hetero = (
                  osp.exists(
                      osp.join(self.root, "raw", "edge_index_dict.npz")
                  )
                  and self.is_hetero
              )
          else:
              # csv file
              has_necessary_file_simple = osp.exists(
                  osp.join(self.root, "raw", "edge.csv.gz")
              ) and (not self.is_hetero)
              has_necessary_file_hetero = (
                  osp.exists(
                      osp.join(
                          self.root, "raw", "triplet-type-list.csv.gz"
                      )
                  )
                  and self.is_hetero
              )
  
          has_necessary_file = (
              has_necessary_file_simple or has_necessary_file_hetero
          )
  
          if not has_necessary_file:
              url = self.meta_info["url"]
              if decide_download(url):
                  path = download_url(url, self.original_root)
                  extract_zip(path, self.original_root)
                  os.unlink(path)
                  # delete folder if there exists
                  try:
                      shutil.rmtree(self.root)
                  except:
                      pass
                  shutil.move(
                      osp.join(self.original_root, self.download_name),
                      self.root,
                  )
              else:
                  print("Stop download.")
                  exit(-1)
  
          raw_dir = osp.join(self.root, "raw")
  
          ### pre-process and save
          add_inverse_edge = (
              self.meta_info["add_inverse_edge"] == "True"
          )
  
          if self.meta_info["additional node files"] == "None":
              additional_node_files = []
          else:
              additional_node_files = self.meta_info[
                  "additional node files"
              ].split(",")
  
          if self.meta_info["additional edge files"] == "None":
              additional_edge_files = []
          else:
              additional_edge_files = self.meta_info[
                  "additional edge files"
              ].split(",")
  
          if self.is_hetero:
              if self.binary:
                  self.graph = read_binary_heterograph_raw(
                      raw_dir, add_inverse_edge=add_inverse_edge
                  )[
                      0
                  ]  # only a single graph
  
                  tmp = np.load(osp.join(raw_dir, "node-label.npz"))
                  self.labels = {}
                  for key in list(tmp.keys()):
                      self.labels[key] = tmp[key]
                  del tmp
              else:
                  self.graph = read_csv_heterograph_raw(
                      raw_dir,
                      add_inverse_edge=add_inverse_edge,
                      additional_node_files=additional_node_files,
                      additional_edge_files=additional_edge_files,
                  )[
                      0
                  ]  # only a single graph
                  self.labels = read_node_label_hetero(raw_dir)
  
          else:
              if self.binary:
                  self.graph = read_binary_graph_raw(
                      raw_dir, add_inverse_edge=add_inverse_edge
                  )[
                      0
                  ]  # only a single graph
                  self.labels = np.load(
                      osp.join(raw_dir, "node-label.npz")
                  )["node_label"]
              else:
                  self.graph = read_csv_graph_raw(
                      raw_dir,
                      add_inverse_edge=add_inverse_edge,
                      additional_node_files=additional_node_files,
                      additional_edge_files=additional_edge_files,
                  )[
                      0
                  ]  # only a single graph
                  self.labels = pd.read_csv(
                      osp.join(raw_dir, "node-label.csv.gz"),
                      compression="gzip",
                      header=None,
                  ).values
  
          print("Saving...")
          torch.save(
              {"graph": self.graph, "labels": self.labels},
              pre_processed_file_path,
              pickle_protocol=4,
          )
  
file_path: ogb/ogb/nodeproppred/dataset.py
imports: import pandas
  import shutil, os
  import os.path
  from ogb.utils.url import decide_download, download_url, extract_zip
  from ogb.io.read_graph_raw import read_csv_graph_raw, read_csv_heterograph_raw, read_node_label_hetero, read_nodesplitidx_split_hetero, read_binary_graph_raw, read_binary_heterograph_raw
  import torch
  import numpy
label_desc: Use image node_id 2 for calling the NodePropPredDataset obj's underlying member method code with example usage: obj.pre_process() without return types