code: def dense_union(ind1, data1, ind2, data2):
      result_ind = arr_union(ind1, ind2)
      result_data1 = np.zeros(result_ind.shape[0], dtype=np.float32)
      result_data2 = np.zeros(result_ind.shape[0], dtype=np.float32)
  
      i1 = 0
      i2 = 0
      nnz = 0
  
      # pass through both index lists
      while i1 < ind1.shape[0] and i2 < ind2.shape[0]:
          j1 = ind1[i1]
          j2 = ind2[i2]
  
          if j1 == j2:
              val = data1[i1] + data2[i2]
              if val != 0:
                  result_data1[nnz] = data1[i1]
                  result_data2[nnz] = data2[i2]
                  nnz += 1
              i1 += 1
              i2 += 1
          elif j1 < j2:
              val = data1[i1]
              if val != 0:
                  result_data1[nnz] = data1[i1]
                  nnz += 1
              i1 += 1
          else:
              val = data2[i2]
              if val != 0:
                  result_data2[nnz] = data2[i2]
                  nnz += 1
              i2 += 1
  
      # pass over the tails
      while i1 < ind1.shape[0]:
          val = data1[i1]
          if val != 0:
              result_data1[nnz] = data1[i1]
              nnz += 1
          i1 += 1
  
      while i2 < ind2.shape[0]:
          val = data2[i2]
          if val != 0:
              result_data2[nnz] = data2[i2]
              nnz += 1
          i2 += 1
  
      # truncate to the correct length in case there were zeros
      result_data1 = result_data1[:nnz]
      result_data2 = result_data2[:nnz]
  
      return result_data1, result_data2
  
imports: from __future__ import print_function
  import locale
  import numpy
  import numba
  from pynndescent.utils import norm, tau_rand
  from pynndescent.distances import kantorovich, jensen_shannon_divergence, symmetric_kl_divergence
label_desc: Use image node_id 10 for calling a global function with example usage: dense_union(ind1, data1, ind2, data2) and returns: result_data1,  result_data2