class_docstr: A dataset describing the `Product ecology
  <https://wiki.opensourceecology.org/wiki/Product_Ecologies>`_ of the Open
  Source Ecology's iconoclastic `Global Village Construction Set
  <https://wiki.opensourceecology.org/wiki/
  Global_Village_Construction_Set>`_.
  GVCS is a modular, DIY, low-cost set of blueprints that enables the
  fabrication of the 50 different industrial machines that it takes to
  build a small, sustainable civilization with modern comforts.
  
  The dataset contains a heterogenous graphs with 50 :obj:`machine` nodes,
  composing the GVCS, and 290 directed edges, each representing one out of
  three relationships between machines.
  
  Args:
      root (str): Root directory where the dataset should be saved.
      transform (callable, optional): A function/transform that takes in an
          :obj:`torch_geometric.data.HeteroData` 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.HeteroData` object and returns a
          transformed version. The data object will be transformed before
          being saved to disk. (default: :obj:`None`)
      force_reload (bool, optional): Whether to re-process the dataset.
          (default: :obj:`False`)
class_docstr_tok: ["A","dataset","describing","the","`","Product","ecology","<","https",":","\/\/wiki.opensourceecology.org\/wiki\/Product_Ecologies",">","`","_","of","the","Open","Source","Ecology","'s","iconoclastic","`","Global","Village","Construction","Set","<","https",":","\/\/wiki.opensourceecology.org\/wiki\/","Global_Village_Construction_Set",">","`","_",".","GVCS","is","a","modular",",","DIY",",","low-cost","set","of","blueprints","that","enables","the","fabrication","of","the","50","different","industrial","machines","that","it","takes","to","build","a","small",",","sustainable","civilization","with","modern","comforts",".","The","dataset","contains","a","heterogenous","graphs","with","50",":","obj",":","`","machine","`","nodes",",","composing","the","GVCS",",","and","290","directed","edges",",","each","representing","one","out","of","three","relationships","between","machines",".","Args",":","root","(","str",")",":","Root","directory","where","the","dataset","should","be","saved",".","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an",":","obj",":","`","torch_geometric.data.HeteroData","`","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.HeteroData","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","being","saved","to","disk",".","(","default",":",":","obj",":","`","None","`",")","force_reload","(","bool",",","optional",")",":","Whether","to","re-process","the","dataset",".","(","default",":",":","obj",":","`","False","`",")"]
code: def process(self) -> None:
      data = HeteroData()
  
      categories = []
      edges = defaultdict(list)
  
      for path in self.raw_paths:
          with open(path, "r") as f:
              product = json.load(f)
          categories.append(self.categories.index(product["category"]))
          for interaction in product["ecology"]:
              # NOTE Some ecology items are not GVCS machines or have other
              # relationship types we don't want included.
              rt = interaction["relationship"]
              if rt not in self.relationships:
                  continue
              dst = interaction["tool"]
              if dst not in self.machines:
                  continue
              # Machines are guaranteed to be sorted according to their order
              # in `self.machines`, so we can use its index for the mapping:
              src = self.machines.index(product["machine"])
              dst = self.machines.index(dst)
              edges[rt].append((src, dst))
  
      data["machine"].num_nodes = len(categories)
      data["machine"].category = torch.tensor(categories)
  
      for (
          rel,
          edge_indices,
      ) in edges.items():
          edge_index = torch.tensor(edge_indices).t().contiguous()
          data["machine", rel, "machine"].edge_index = edge_index
  
      if self.pre_transform is not None:
          data = self.pre_transform(data)
  
      self.save([data], self.processed_paths[0])
  
file_path: pytorch_geometric/torch_geometric/datasets/ose_gvcs.py
imports: import json
  import os
  from collections import defaultdict
  from typing import Callable, List, Optional
  import torch
  from torch_geometric.data import HeteroData, InMemoryDataset, download_url, extract_tar
label_desc: Use image node_id 5 for calling the OSE_GVCS obj's underlying member method code with example usage: obj.process() without return types