class_docstr: The MalNet Tiny dataset from the
  `"A Large-Scale Database for Graph Representation Learning"
  <https://openreview.net/pdf?id=1xDTDk3XPW>`_ paper.
  :class:`MalNetTiny` contains 5,000 malicious and benign software function
  call graphs across 5 different types. Each graph contains at most 5k nodes.
  
  Args:
      root (str): Root directory where the dataset should be saved.
      split (str, optional): If :obj:`"train"`, loads the training dataset.
          If :obj:`"val"`, loads the validation dataset.
          If :obj:`"trainval"`, loads the training and validation dataset.
          If :obj:`"test"`, loads the test dataset.
          If :obj:`None`, loads the entire dataset.
          (default: :obj:`None`)
      transform (callable, optional): A function/transform that takes in an
          :obj:`torch_geometric.data.Data` object and returns a transformed
          version. The data object will be transformed before every access.
          (default: :obj:`None`)
      pre_transform (callable, optional): A function/transform that takes in
          an :obj:`torch_geometric.data.Data` object and returns a
          transformed version. The data object will be transformed before
          being saved to disk. (default: :obj:`None`)
      pre_filter (callable, optional): A function that takes in an
          :obj:`torch_geometric.data.Data` object and returns a boolean
          value, indicating whether the data object should be included in the
          final dataset. (default: :obj:`None`)
      force_reload (bool, optional): Whether to re-process the dataset.
          (default: :obj:`False`)
class_docstr_tok: ["The","MalNet","Tiny","dataset","from","the","`","``","A","Large-Scale","Database","for","Graph","Representation","Learning","''","<","https",":","\/\/openreview.net\/pdf","?","id=1xDTDk3XPW",">","`","_","paper",".",":","class",":","`","MalNetTiny","`","contains","5,000","malicious","and","benign","software","function","call","graphs","across","5","different","types",".","Each","graph","contains","at","most","5k","nodes",".","Args",":","root","(","str",")",":","Root","directory","where","the","dataset","should","be","saved",".","split","(","str",",","optional",")",":","If",":","obj",":","`","``","train","''","`",",","loads","the","training","dataset",".","If",":","obj",":","`","``","val","''","`",",","loads","the","validation","dataset",".","If",":","obj",":","`","``","trainval","''","`",",","loads","the","training","and","validation","dataset",".","If",":","obj",":","`","``","test","''","`",",","loads","the","test","dataset",".","If",":","obj",":","`","None","`",",","loads","the","entire","dataset",".","(","default",":",":","obj",":","`","None","`",")","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an",":","obj",":","`","torch_geometric.data.Data","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","every","access",".","(","default",":",":","obj",":","`","None","`",")","pre_transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an",":","obj",":","`","torch_geometric.data.Data","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","being","saved","to","disk",".","(","default",":",":","obj",":","`","None","`",")","pre_filter","(","callable",",","optional",")",":","A","function","that","takes","in","an",":","obj",":","`","torch_geometric.data.Data","`","object","and","returns","a","boolean","value",",","indicating","whether","the","data","object","should","be","included","in","the","final","dataset",".","(","default",":",":","obj",":","`","None","`",")","force_reload","(","bool",",","optional",")",":","Whether","to","re-process","the","dataset",".","(","default",":",":","obj",":","`","False","`",")"]
code: def process(self) -> None:
      y_map: Dict[str, int] = {}
      data_list = []
      split_slices = [0]
  
      for split in ["train", "val", "test"]:
          with open(
              osp.join(self.raw_paths[1], f"{split}.txt"), "r"
          ) as f:
              filenames = f.read().split("\n")[:-1]
              split_slices.append(split_slices[-1] + len(filenames))
  
          for filename in filenames:
              path = osp.join(self.raw_paths[0], f"{filename}.edgelist")
              malware_type = filename.split("/")[0]
              y = y_map.setdefault(malware_type, len(y_map))
  
              with open(path, "r") as f:
                  edges = f.read().split("\n")[5:-1]
  
              edge_indices = [
                  [int(s) for s in e.split()] for e in edges
              ]
              edge_index = torch.tensor(edge_indices).t().contiguous()
              num_nodes = int(edge_index.max()) + 1
              data = Data(
                  edge_index=edge_index, y=y, num_nodes=num_nodes
              )
              data_list.append(data)
  
      if self.pre_filter is not None:
          data_list = [
              data for data in data_list if self.pre_filter(data)
          ]
  
      if self.pre_transform is not None:
          data_list = [self.pre_transform(data) for data in data_list]
  
      self.save(data_list, self.processed_paths[0])
      torch.save(split_slices, self.processed_paths[1])
  
file_path: pytorch_geometric/torch_geometric/datasets/malnet_tiny.py
imports: import os
  import os.path
  from typing import Callable, Dict, List, Optional
  import torch
  from torch_geometric.data import Data, InMemoryDataset, download_url, extract_tar, extract_zip
label_desc: Use image node_id 5 for calling the MalNetTiny obj's underlying member method code with example usage: obj.process() without return types