class_docstr: Iterator
code: def prepare_data(self):
      dataset = MAG240MDataset(self.data_dir)
      edge_path = f"{dataset.dir}/paper_to_paper_symmetric_pgl"
  
      t = time.perf_counter()
      if not osp.exists(edge_path):
          log.info("Converting adjacency matrix...")
          edge_index = dataset.edge_index("paper", "cites", "paper")
          edge_index = edge_index.T
  
          edges_new = np.zeros((edge_index.shape[0], 2))
          edges_new[:, 0] = edge_index[:, 1]
          edges_new[:, 1] = edge_index[:, 0]
  
          edge_index = np.vstack((edge_index, edges_new))
          edge_index = np.unique(edge_index, axis=0)
  
          graph = Graph(edge_index, sorted=True)
          graph.adj_dst_index
          graph.dump(edge_path)
          log.info(f"Done! [{time.perf_counter() - t:.2f}s]")
  
      np.random.seed(self.seed)
      self.train_idx = dataset.get_idx_split("train")
      #         np.random.shuffle(self.train_idx)
  
      self.val_idx = dataset.get_idx_split("valid")
      self.test_idx = dataset.get_idx_split("test")
  
      self.x = dataset.paper_feat
      self.y = dataset.all_paper_label
  
      self.graph = Graph.load(edge_path, mmap_mode="r+")
      log.info(f"Done! [{time.perf_counter() - t:.2f}s]")
  
imports: import os
  import tqdm
  import yaml
  import pgl
  import time
  import copy
  import numpy
  import os.path
  from pgl.utils.logger import log
  from pgl.graph import Graph
  from pgl import graph_kernel
  from pgl.sampling.custom import subgraph
  from ogb.lsc import MAG240MDataset, MAG240MEvaluator
  from dataset.base_dataset import BaseDataGenerator
  import time
label_desc: Use image node_id 2 for calling the MAG240M obj's underlying member method code with example usage: obj.prepare_data() without return types