code: def to_single_directed(edges):
      edges_new = np.zeros((2, edges.shape[1] // 2), dtype=int)
      j = 0
      for i in range(edges.shape[1]):
          if edges[0, i] < edges[1, i]:
              edges_new[:, j] = edges[:, i]
              j += 1
  
      return edges_new
  
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 2 for calling a global function with example usage: to_single_directed(edges) and returns: edges_new