code: def load_data(
      cls, data_dir: RichPath, data_fold: str
  ) -> List[PPIGraphSample]:
      print(" Loading PPI %s data from %s." % (data_fold, data_dir))
  
      graph_json_data = data_dir.join(
          "%s_graph.json" % data_fold
      ).read_by_file_suffix()
      node_to_features = data_dir.join(
          "%s_feats.npy" % data_fold
      ).read_by_file_suffix()
      node_to_labels = data_dir.join(
          "%s_labels.npy" % data_fold
      ).read_by_file_suffix()
      node_to_graph_id = data_dir.join(
          "%s_graph_id.npy" % data_fold
      ).read_by_file_suffix()
  
      # We read in all the data in two steps:
      #  (1) Read features, labels. Implicitly, this gives us the number of nodes per graph.
      #  (2) Read all edges, and shift them so that each graph starts with node 0.
      fwd_edge_type = 0
  
      graph_id_to_graph_data: Dict[int, PPIGraphSample] = {}
      graph_id_to_node_offset: Dict[int, int] = {}
      num_total_nodes = node_to_features.shape[0]
      for node_id in range(num_total_nodes):
          graph_id = node_to_graph_id[node_id]
          # In case we are entering a new graph, note its ID, so that we can normalise everything to start at 0
          if graph_id not in graph_id_to_graph_data:
              graph_id_to_graph_data[graph_id] = PPIGraphSample(
                  adjacency_lists=[[]],
                  node_features=[],
                  node_labels=[],
              )
              graph_id_to_node_offset[graph_id] = node_id
          cur_graph_data = graph_id_to_graph_data[graph_id]
          cur_graph_data.node_features.append(node_to_features[node_id])
          cur_graph_data.node_labels.append(node_to_labels[node_id])
  
      for edge_info in graph_json_data["links"]:
          src_node, tgt_node = edge_info["source"], edge_info["target"]
          # First, shift node IDs so that each graph starts at node 0:
          graph_id = node_to_graph_id[src_node]
          graph_node_offset = graph_id_to_node_offset[graph_id]
          src_node, tgt_node = (
              src_node - graph_node_offset,
              tgt_node - graph_node_offset,
          )
  
          cur_graph_data = graph_id_to_graph_data[graph_id]
          cur_graph_data.adjacency_lists[fwd_edge_type].append(
              (src_node, tgt_node)
          )
  
      final_graphs = []
      for graph_data in graph_id_to_graph_data.values():
          # numpy-ize:
          adj_lists = [
              np.array(
                  graph_data.adjacency_lists[fwd_edge_type],
                  dtype=np.int32,
              )
          ]
          final_graphs.append(
              PPIGraphSample(
                  adjacency_lists=adj_lists,
                  node_features=np.array(
                      graph_data.node_features, dtype=np.float32
                  ),
                  node_labels=np.array(
                      graph_data.node_labels, dtype=np.bool
                  ),
              )
          )
  
      return final_graphs
  
file_path: ptgnn/ptgnn/implementations/ppi/dataloader.py
imports: import numpy
  from dpu_utils.utils import RichPath
  from typing import Dict, List
label_desc: Use image node_id 1 for calling the PPIDatasetLoader obj's underlying member method code with example usage: obj.load_data(cls, data_dir, data_fold) and returns: final_graphs