code: def write_to_csv(csv_data, write_csv="bench", training=False):
      import pandas as pd
  
      results_path = osp.join(
          osp.dirname(osp.realpath(__file__)), "../results/"
      )
      os.makedirs(results_path, exist_ok=True)
  
      name = "training" if training else "inference"
      if write_csv == "bench":
          csv_file_name = f"TOTAL_{name}_benchmark.csv"
      else:
          csv_file_name = f"TOTAL_prof_{name}_benchmark.csv"
      csv_path = osp.join(results_path, csv_file_name)
      index_label = "TEST_ID" if write_csv == "bench" else "ID"
  
      with_header = not osp.exists(csv_path)
      df = pd.DataFrame(csv_data)
      df.to_csv(
          csv_path,
          mode="a",
          index_label=index_label,
          header=with_header,
      )
  
file_path: pytorch_geometric/benchmark/utils/utils.py
imports: import os
  import os.path
  from datetime import datetime
  import torch
  from ogb.nodeproppred import PygNodePropPredDataset
  from tqdm import tqdm
  import torch_geometric.transforms
  from torch_geometric.data import HeteroData
  from torch_geometric.datasets import OGB_MAG, Reddit
  from torch_geometric.nn import GAT, GCN, PNA, EdgeCNN, GraphSAGE
  from torch_geometric.utils import index_to_mask
  from .hetero_gat import HeteroGAT
  from .hetero_sage import HeteroGraphSAGE
label_desc: Use image node_id 6 for calling a global function with example usage: write_to_csv(csv_data, write_csv, training) without return types