code: def get_pos_neg_edges(data, infer_link_positive=True):
      if infer_link_positive:
          data["positive_edges"] = to_single_directed(
              data["edge_index"].numpy()
          )
      split_edges("positive", data["positive_edges"], data)
  
      # resample edge mask link negative
      negative_edges = get_negative_edges(
          data["positive_edges"],
          data["num_nodes"],
          num_negative_edges=data["positive_edges"].shape[1],
      )
      split_edges("negative", negative_edges, data)
  
      return data
  
imports: import multiprocessing
  import random
  from multiprocessing import get_context
  import networkx
  import numpy
  import torch
  from tqdm.auto import tqdm
label_desc: Use image node_id 6 for calling a global function with example usage: get_pos_neg_edges(data, infer_link_positive) and returns: data