code: def get_pos_neg_edges(split, split_edge, g, percent=100):
      pos_edge = split_edge[split]["edge"]
      if split == "train":
          neg_edge = torch.stack(
              global_uniform_negative_sampling(
                  g,
                  num_samples=pos_edge.size(0),
                  exclude_self_loops=True,
              ),
              dim=1,
          )
      else:
          neg_edge = split_edge[split]["edge_neg"]
  
      # sampling according to the percent param
      np.random.seed(123)
      # pos sampling
      num_pos = pos_edge.size(0)
      perm = np.random.permutation(num_pos)
      perm = perm[: int(percent / 100 * num_pos)]
      pos_edge = pos_edge[perm]
      # neg sampling
      if neg_edge.dim() > 2:  # [Np, Nn, 2]
          neg_edge = neg_edge[perm].view(-1, 2)
      else:
          np.random.seed(123)
          num_neg = neg_edge.size(0)
          perm = np.random.permutation(num_neg)
          perm = perm[: int(percent / 100 * num_neg)]
          neg_edge = neg_edge[perm]
  
      return pos_edge, neg_edge
  
file_path: dgl/examples/pytorch/ogb/ngnn_seal/utils.py
imports: import random
  import sys
  import numpy
  import torch
  from dgl.sampling import global_uniform_negative_sampling
  from scipy.sparse.csgraph import shortest_path
label_desc: Use image node_id 3 for calling a global function with example usage: get_pos_neg_edges(split, split_edge, g, percent) and returns: pos_edge,  neg_edge