code: def cmap_transform(graph, num_edge_types, input_dim=5):
      # get nx graph
      G = graph.G
      for v in G.nodes:
          G.nodes[v]["node_feature"] = torch.ones(input_dim)
  
      for u, v, edge_key in G.edges:
          l = G[u][v][edge_key].pop("edge_de", None)
          e_feat = torch.zeros(num_edge_types)
          e_feat[l] = 1.0
  
          # here both feature and label are relation types
          G[u][v][edge_key]["edge_feature"] = e_feat
          G[u][v][edge_key]["edge_label"] = l
  
      graph.G = G
      return graph
  
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 2 for calling a global function with example usage: cmap_transform(graph, num_edge_types, input_dim) and returns: graph