code: def prepare_data(self):
      log.info("Preparing dataset...")
      dataset = MAG240MDataset(self.data_dir)
  
      # Get feature and graph.
      graph_file_list = []
      paper_edge_path = (
          f"{dataset.dir}/paper_to_paper_symmetric_pgl_split"
      )
      graph_file_list.append(paper_edge_path)
      author_edge_path = (
          f"{dataset.dir}/paper_to_author_symmetric_pgl_split_src"
      )
      graph_file_list.append(author_edge_path)
      author_edge_path = (
          f"{dataset.dir}/paper_to_author_symmetric_pgl_split_dst"
      )
      graph_file_list.append(author_edge_path)
      institution_edge_path = (
          f"{dataset.dir}/institution_edge_symmetric_pgl_split_src"
      )
      graph_file_list.append(institution_edge_path)
      institution_edge_path = (
          f"{dataset.dir}/institution_edge_symmetric_pgl_split_dst"
      )
      graph_file_list.append(institution_edge_path)
  
      np.random.seed(self.seed)
      valid_file = os.listdir(self.valid_path)
      valid_file = [v_n for v_n in valid_file if v_n != self.valid_name]
  
      if self.ensemble_setting:
          valid_temp = []
          for v_n in valid_file:
              path = os.path.join(self.valid_path, v_n)
              valid_temp.append(np.load(path))
          valid_temp = np.concatenate(valid_temp)
          self.train_idx = np.concatenate(
              [dataset.get_idx_split("train"), valid_temp]
          )
  
          valid_name = os.path.join(self.valid_path, self.valid_name)
          self.val_idx = np.load(valid_name)
      else:
          self.feat_mode = "cpu"
          self.train_idx = dataset.get_idx_split("train")
          valid_name = os.path.join(self.valid_path, self.valid_name)
          self.val_idx = np.load(valid_name)
  
      self.test_idx = dataset.get_idx_split("test-challenge")
      self.test_dev_idx = dataset.get_idx_split("test-dev")
      N = (
          dataset.num_papers
          + dataset.num_authors
          + dataset.num_institutions
      )
      self.train_idx_mask = np.zeros([N], dtype="bool")
      if self.ensemble_setting:
          self.train_idx_mask[
              np.concatenate([self.train_idx, self.val_idx])
          ] = 1
      else:
          self.train_idx_mask[self.train_idx] = 1
      self.train_idx_mask = paddle.to_tensor(self.train_idx_mask)
      self.x = np.memmap(
          f"{dataset.dir}/full_feat.npy",
          dtype=np.float16,
          mode="r",
          shape=(N, self.num_features),
      )
      self.id_x = np.memmap(
          f"{self.m2v_file}",
          dtype=np.float16,
          mode="r",
          shape=(N, self.m2v_dim),
      )
      self.p2p_x = np.memmap(
          f"{self.p2p_file}",
          dtype=np.float16,
          mode="r",
          shape=(N, self.m2v_dim),
      )
      from dist_feat import DistFeat
  
      self.x = DistFeat(self.x, mode=self.feat_mode)
      self.id_x = DistFeat(self.id_x, mode=self.feat_mode)
      self.p2p_x = DistFeat(self.p2p_x, mode=self.feat_mode)
      self.y = dataset.all_paper_label
      self.y = paddle.to_tensor(self.y, dtype="int64")
      year_file = f"{dataset.dir}/all_feat_year.npy"
      self.year = np.memmap(
          year_file, dtype=np.int32, mode="r", shape=(N,)
      )
      self.year = paddle.to_tensor(self.year, dtype="int32")
      self.graphs = [
          Graph.load(edge_path, mmap_mode="r+")
          for edge_path in graph_file_list
      ]
      self.prepare_csc_graph()
  
      def get_sinusoid_encoding_table(
          n_position, d_hid, padding_idx=None
      ):
          def cal_angle(position, hid_idx):
              return position / np.power(
                  10000, 2 * (hid_idx // 2) / d_hid
              )
  
          def get_posi_angle_vec(position):
              return [
                  cal_angle(position, hid_j) for hid_j in range(d_hid)
              ]
  
          sinusoid_table = np.array(
              [get_posi_angle_vec(pos_i) for pos_i in range(n_position)]
          )
          sinusoid_table[:, 0::2] = np.sin(
              sinusoid_table[:, 0::2]
          )  # dim 2i
          sinusoid_table[:, 1::2] = np.cos(
              sinusoid_table[:, 1::2]
          )  # dim 2i+1
          return sinusoid_table
  
      self.pos = get_sinusoid_encoding_table(200, 768)
      self.pos = paddle.to_tensor(self.pos)
  
imports: import os
  import pdb
  import argparse
  import numpy
  import yaml
  from easydict import EasyDict
  import paddle
  from paddle.io import Dataset
  from pgl.graph import Graph
  from ogb.lsc import MAG240MDataset
  from pgl.utils.logger import log
  from paddle.framework import core
label_desc: Use image node_id 2 for calling the MAG240M obj's underlying member method code with example usage: obj.prepare_data() and returns: sinusoid_table, unknown, unknown