code: def read_graph_pyg(
      raw_dir,
      add_inverse_edge=False,
      additional_node_files=[],
      additional_edge_files=[],
      binary=False,
  ):
      if binary:
          # npz
          graph_list = read_binary_graph_raw(raw_dir, add_inverse_edge)
      else:
          # csv
          graph_list = read_csv_graph_raw(
              raw_dir,
              add_inverse_edge,
              additional_node_files=additional_node_files,
              additional_edge_files=additional_edge_files,
          )
  
      pyg_graph_list = []
  
      print("Converting graphs into PyG objects...")
  
      for graph in tqdm(graph_list):
          g = Data()
          g.num_nodes = graph["num_nodes"]
          g.edge_index = torch.from_numpy(graph["edge_index"])
  
          del graph["num_nodes"]
          del graph["edge_index"]
  
          if graph["edge_feat"] is not None:
              g.edge_attr = torch.from_numpy(graph["edge_feat"])
              del graph["edge_feat"]
  
          if graph["node_feat"] is not None:
              g.x = torch.from_numpy(graph["node_feat"])
              del graph["node_feat"]
  
          for key in additional_node_files:
              g[key] = torch.from_numpy(graph[key])
              del graph[key]
  
          for key in additional_edge_files:
              g[key] = torch.from_numpy(graph[key])
              del graph[key]
  
          pyg_graph_list.append(g)
  
      return pyg_graph_list
  
file_path: ogb/ogb/io/read_graph_pyg.py
imports: import pandas
  import torch
  from torch_geometric.data import Data
  import os.path
  import numpy
  from ogb.io.read_graph_raw import read_csv_graph_raw, read_csv_heterograph_raw, read_binary_graph_raw, read_binary_heterograph_raw
  from tqdm.auto import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: read_graph_pyg(raw_dir, add_inverse_edge, additional_node_files, additional_edge_files, binary) and returns: pyg_graph_list