code: def edge_nets(graph):
      """get networks for mini batch edge prediction tasks"""
      # color center
      n = graph.num_nodes
      # A proper deepsnap.G should have nodes indexed from 0 to n-1
      # relabel egos: keep center node ID, relabel other node IDs
      G_raw = graph.G
      G = graph.G.__class__()
      for i in range(n):
          keys = list(G_raw.nodes)
          vals = range(i * n, (i + 1) * n)
          mapping = dict(zip(keys, vals))
          G_raw = nx.relabel_nodes(G_raw, mapping, copy=True)
          G.add_nodes_from(G_raw.nodes(data=True))
          G.add_edges_from(G_raw.edges(data=True))
      graph.G = G
      graph.node_id_index = torch.arange(0, n * n, n + 1)
  
      # change link_pred to conditional node classification task
      graph.node_label = graph.edge_label
      bias = graph.edge_label_index[0] * n
      graph.node_label_index = graph.edge_label_index[1] + bias
  
      graph.edge_label = None
      graph.edge_label_index = None
  
file_path: GraphGym/graphgym/models/transform.py
imports: import networkx
  import torch
  from torch_geometric.utils import negative_sampling
label_desc: Use image node_id 3 for calling a global function with example usage: edge_nets(graph) without return types