code: def _prime_orient_merge(
      ppr_pairs: np.ndarray,
      primes_per_batch: int,
      num_nodes: int,
  ):
      id_primes_list = list(
          np.arange(num_nodes, dtype=np.int32).reshape(-1, 1)
      )
      node_id_list = np.arange(num_nodes, dtype=np.int32)
      placeholder = np.zeros(0, dtype=np.int32)
  
      for i, j in ppr_pairs:
          id1, id2 = node_id_list[i], node_id_list[j]
          if id1 > id2:
              id1, id2 = id2, id1
  
          if (
              id1 != id2
              and len(id_primes_list[id1]) + len(id_primes_list[id2])
              <= primes_per_batch
          ):
              id_primes_list[id1] = np.concatenate(
                  (id_primes_list[id1], id_primes_list[id2])
              )
              node_id_list[id_primes_list[id2]] = id1
              id_primes_list[id2] = placeholder
  
      prime_lst = list()
      ids = np.unique(node_id_list)
  
      for _id in ids:
          prime_lst.append(list(id_primes_list[_id]))
  
      return list(prime_lst)
  
imports: import logging
  import math
  from typing import Callable, Iterator, List, NamedTuple, Optional, Tuple, Union
  import numpy
  import scipy.sparse
  import torch
  from torch import Tensor
  from tqdm import tqdm
  from torch_geometric.data import Data
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import get_ppr, is_undirected, subgraph
label_desc: Use image node_id 9 for calling a global function with example usage: _prime_orient_merge(ppr_pairs, primes_per_batch, num_nodes) and returns: list