code: def sparse_sum(ind1, data1, ind2, data2):
      result_ind = arr_union(ind1, ind2)
      result_data = 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_ind[nnz] = j1
                  result_data[nnz] = val
                  nnz += 1
              i1 += 1
              i2 += 1
          elif j1 < j2:
              val = data1[i1]
              if val != 0:
                  result_ind[nnz] = j1
                  result_data[nnz] = val
                  nnz += 1
              i1 += 1
          else:
              val = data2[i2]
              if val != 0:
                  result_ind[nnz] = j2
                  result_data[nnz] = val
                  nnz += 1
              i2 += 1
  
      # pass over the tails
      while i1 < ind1.shape[0]:
          val = data1[i1]
          if val != 0:
              result_ind[nnz] = ind1[i1]
              result_data[nnz] = val
              nnz += 1
          i1 += 1
  
      while i2 < ind2.shape[0]:
          val = data2[i2]
          if val != 0:
              result_ind[nnz] = ind2[i2]
              result_data[nnz] = val
              nnz += 1
          i2 += 1
  
      # truncate to the correct length in case there were zeros created
      result_ind = result_ind[:nnz]
      result_data = result_data[:nnz]
  
      return result_ind, result_data
  
imports: from __future__ import print_function
  import locale
  import numba
  import numpy
  from umap.utils import norm
label_desc: Use image node_id 4 for calling a global function with example usage: sparse_sum(ind1, data1, ind2, data2) and returns: result_ind,  result_data