code: def read_and_split_cmap_data(path, split_ratio=[0.8, 0.2]):
      nxG_train = nx.DiGraph()
      nxG_test = nx.DiGraph()
  
      train_ratio = split_ratio[0]
  
      with open(path, newline="") as csvfile:
          reader = csv.reader(
              csvfile, delimiter=",", quoting=csv.QUOTE_NONNUMERIC
          )
          next(reader)
          for row in reader:
              if row[2] == -1:
                  de = 0
              elif row[2] == 1:
                  de = 1
              if np.random.rand() < train_ratio:
                  nxG_train.add_edge(
                      row[0],
                      row[1],
                      edge_de=de,
                      edge_dose=row[4],
                      edge_pert_time=row[5],
                  )
              else:
                  nxG_test.add_edge(
                      row[0],
                      row[1],
                      edge_de=de,
                      edge_dose=row[4],
                      edge_pert_time=row[5],
                  )
      nxG_train.add_nodes_from(nxG_test)
      nxG_test.add_nodes_from(nxG_train)
      return nxG_train, nxG_test
  
imports: import argparse
  import copy
  import csv
  import numpy
  import time
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.tensorboard import SummaryWriter
  import networkx
  import numpy
  import sklearn.metrics
  import torch_geometric.transforms
  import torch_geometric.nn
  from torch.utils.data import DataLoader
  from deepsnap.hetero_graph import HeteroGraph
  from deepsnap.dataset import GraphDataset
  from deepsnap.batch import Batch
label_desc: Use image node_id 5 for calling a global function with example usage: read_and_split_cmap_data(path, split_ratio) and returns: nxG_train,  nxG_test