docstr: process raw data to graph, labels and masks
docstr_tok: ["process","raw","data","to","graph",",","labels","and","masks"]
code: def process(self):
      """process raw data to graph, labels and masks"""
      data = sio.loadmat(
          os.path.join(self.raw_path, f"{self.name}_retweet_graph.mat")
      )
  
      adj = data["graph"].tocoo()
      num_edges = len(adj.row)
      row, col = (
          adj.row[: int(num_edges / 2)],
          adj.col[: int(num_edges / 2)],
      )
  
      graph = dgl.graph(
          (np.concatenate((row, col)), np.concatenate((col, row)))
      )
      news_labels = data["label"].squeeze()
      num_news = len(news_labels)
  
      node_feature = np.load(
          os.path.join(self.raw_path, f"{self.name}_node_feature.npy")
      )
      edge_feature = np.load(
          os.path.join(self.raw_path, f"{self.name}_edge_feature.npy")
      )[: int(num_edges / 2)]
  
      graph.ndata["feat"] = th.tensor(node_feature)
      graph.edata["feat"] = th.tensor(np.tile(edge_feature, (2, 1)))
      pos_news = news_labels.nonzero()[0]
  
      edge_labels = th.zeros(num_edges)
      edge_labels[graph.in_edges(pos_news, form="eid")] = 1
      edge_labels[graph.out_edges(pos_news, form="eid")] = 1
      graph.edata["label"] = edge_labels
  
      ntypes = th.ones(graph.num_nodes(), dtype=int)
      etypes = th.ones(graph.num_edges(), dtype=int)
  
      ntypes[graph.nodes() < num_news] = 0
      etypes[: int(num_edges / 2)] = 0
  
      graph.ndata["_TYPE"] = ntypes
      graph.edata["_TYPE"] = etypes
  
      hg = dgl.to_heterogeneous(
          graph, ["v", "u"], ["forward", "backward"]
      )
      self._random_split(hg, self.seed, self.train_size, self.val_size)
  
      self.graph = hg
  
file_path: dgl/examples/pytorch/gas/dataloader.py
imports: import os
  import dgl
  import numpy
  import scipy.io
  import torch
  from dgl.data import DGLBuiltinDataset
  from dgl.data.utils import _get_dgl_url, load_graphs, save_graphs
label_desc: Use image node_id 2 for calling the GASDataset obj's underlying member method code with example usage: obj.process() without return types