code: def diversify(
      indices,
      distances,
      data_indices,
      data_indptr,
      data_data,
      dist,
      rng_state,
      prune_probability=1.0,
  ):
      for i in numba.prange(indices.shape[0]):
          new_indices = [indices[i, 0]]
          new_distances = [distances[i, 0]]
          for j in range(1, indices.shape[1]):
              if indices[i, j] < 0:
                  break
  
              flag = True
              for k in range(len(new_indices)):
                  c = new_indices[k]
  
                  from_ind = data_indices[
                      data_indptr[indices[i, j]] : data_indptr[
                          indices[i, j] + 1
                      ]
                  ]
                  from_data = data_data[
                      data_indptr[indices[i, j]] : data_indptr[
                          indices[i, j] + 1
                      ]
                  ]
  
                  to_ind = data_indices[
                      data_indptr[c] : data_indptr[c + 1]
                  ]
                  to_data = data_data[
                      data_indptr[c] : data_indptr[c + 1]
                  ]
  
                  d = dist(from_ind, from_data, to_ind, to_data)
                  if (
                      new_distances[k] > FLOAT32_EPS
                      and d < distances[i, j]
                  ):
                      if tau_rand(rng_state) < prune_probability:
                          flag = False
                          break
  
              if flag:
                  new_indices.append(indices[i, j])
                  new_distances.append(distances[i, j])
  
          for j in range(indices.shape[1]):
              if j < len(new_indices):
                  indices[i, j] = new_indices[j]
                  distances[i, j] = new_distances[j]
              else:
                  indices[i, j] = -1
                  distances[i, j] = np.inf
  
      return indices, distances
  
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 44 for calling a global function with example usage: diversify(indices, distances, data_indices, data_indptr, data_data, dist, rng_state, prune_probability) and returns: indices,  distances