code: def prepare_graph(self):
      processed_dir = osp.join(self.folder, "processed")
      raw_dir = osp.join(self.folder, "raw")
      pre_processed_file_path = osp.join(
          processed_dir, "dgl_data_processed"
      )
  
      if osp.exists(pre_processed_file_path):
          # if pre-processed file already exists
          self.graphs, label_dict = load_graphs(pre_processed_file_path)
          self.labels = label_dict["labels"]
      else:
          # if pre-processed file does not exist
  
          if not osp.exists(osp.join(raw_dir, "data.csv.gz")):
              # if the raw file does not exist, then download it.
              self.download()
  
          data_df = pd.read_csv(osp.join(raw_dir, "data.csv.gz"))
          smiles_list = data_df["smiles"]
          homolumogap_list = data_df["homolumogap"]
  
          print("Converting SMILES strings into graphs...")
          self.graphs = []
          self.labels = []
          for i in tqdm(range(len(smiles_list))):
              smiles = smiles_list[i]
              homolumogap = homolumogap_list[i]
              graph = self.smiles2graph(smiles)
  
              assert (
                  len(graph["edge_feat"])
                  == graph["edge_index"].shape[1]
              )
              assert len(graph["node_feat"]) == graph["num_nodes"]
  
              dgl_graph = dgl.graph(
                  (graph["edge_index"][0], graph["edge_index"][1]),
                  num_nodes=graph["num_nodes"],
              )
              dgl_graph.edata["feat"] = torch.from_numpy(
                  graph["edge_feat"]
              ).to(torch.int64)
              dgl_graph.ndata["feat"] = torch.from_numpy(
                  graph["node_feat"]
              ).to(torch.int64)
  
              self.graphs.append(dgl_graph)
              self.labels.append(homolumogap)
  
          self.labels = torch.tensor(self.labels, dtype=torch.float32)
  
          # double-check prediction target
          split_dict = self.get_idx_split()
          assert all(
              [
                  not torch.isnan(self.labels[i])
                  for i in split_dict["train"]
              ]
          )
          assert all(
              [
                  not torch.isnan(self.labels[i])
                  for i in split_dict["valid"]
              ]
          )
          assert all(
              [
                  torch.isnan(self.labels[i])
                  for i in split_dict["test-dev"]
              ]
          )
          assert all(
              [
                  torch.isnan(self.labels[i])
                  for i in split_dict["test-challenge"]
              ]
          )
  
          print("Saving...")
          save_graphs(
              pre_processed_file_path,
              self.graphs,
              labels={"labels": self.labels},
          )
  
imports: import os
  import os.path
  import shutil
  from ogb.utils import smiles2graph
  from ogb.utils.torch_util import replace_numpy_with_torchtensor
  from ogb.utils.url import decide_download, download_url, extract_zip
  import pandas
  import numpy
  from dgl.data.utils import load_graphs, save_graphs, Subset
  import dgl
  from tqdm.auto import tqdm
  import torch
label_desc: Use image node_id 3 for calling the DglPCQM4Mv2Dataset obj's underlying member method code with example usage: obj.prepare_graph() without return types