code: def WN_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]["e_label"]
          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
      # optionally return the graph or G object
      graph.G = G
      return graph
  
imports: import copy
  import argparse
  import torch
  import torch.nn
  import torch.nn.functional
  import networkx
  import numpy
  import sklearn.metrics
  import torch_geometric.nn
  from torch.utils.data import DataLoader
  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: WN_transform(graph, num_edge_types, input_dim) and returns: graph