code: def to_pyg_hetero_data(self):
      from torch_geometric.data import HeteroData
  
      data = HeteroData()
  
      path = osp.join(self.dir, "processed", "paper", "node_feat.npy")
      data["paper"].x = torch.from_numpy(np.load(path))
  
      path = osp.join(self.dir, "processed", "paper", "node_label.npy")
      data["paper"].y = torch.from_numpy(np.load(path))
      data.num_classes = self.num_classes
  
      path = osp.join(self.dir, "processed", "paper", "node_year.npy")
      data["paper"].year = torch.from_numpy(np.load(path))
  
      data["author"].num_nodes = self.__meta__["author"]
      data["institution"].num_nodes = self.__meta__["institution"]
  
      for edge_type in [
          ("author", "affiliated_with", "institution"),
          ("author", "writes", "paper"),
          ("paper", "cites", "paper"),
      ]:
          name = "___".join(edge_type)
          path = osp.join(self.dir, "processed", name, "edge_index.npy")
          edge_index = torch.from_numpy(np.load(path))
          data[edge_type].edge_index = edge_index
          data[
              edge_type[-1], f"rev_{edge_type[1]}", edge_type[0]
          ].edge_index = edge_index.flip([0])
  
      for f, v in [
          ("train", "train"),
          ("valid", "val"),
          ("test-dev", "test"),
      ]:
          idx = self.get_idx_split(f)
          idx = torch.from_numpy(idx)
          mask = torch.zeros(data["paper"].num_nodes, dtype=torch.bool)
          mask[idx] = True
          data["paper"][f"{v}_mask"] = mask
  
      return data
  
imports: from typing import Optional, Union, Dict
  import os
  import shutil
  import os.path
  import torch
  import numpy
  from ogb.utils.url import decide_download, download_url, extract_zip, makedirs
  from ogb.lsc.utils import split_test
label_desc: Use image node_id 3 for calling the MAG240MDataset obj's underlying member method code with example usage: obj.to_pyg_hetero_data() and returns: data