code: def negative_sampling(edge_index, num_nodes):
      # Sample edges by corrupting either the subject or the object of each edge.
      mask_1 = torch.rand(edge_index.size(1)) < 0.5
      mask_2 = ~mask_1
  
      neg_edge_index = edge_index.clone()
      neg_edge_index[0, mask_1] = torch.randint(
          num_nodes, (mask_1.sum(),), device=neg_edge_index.device
      )
      neg_edge_index[1, mask_2] = torch.randint(
          num_nodes, (mask_2.sum(),), device=neg_edge_index.device
      )
      return neg_edge_index
  
imports: import os.path
  import time
  import torch
  import torch.nn.functional
  from torch.nn import Parameter
  from tqdm import tqdm
  from torch_geometric.datasets import RelLinkPredDataset
  from torch_geometric.nn import GAE, RGCNConv
label_desc: Use image node_id 1 for calling a global function with example usage: negative_sampling(edge_index, num_nodes) and returns: neg_edge_index