code: def init_random(
      n_neighbors, inds, indptr, data, heap, dist, rng_state
  ):
      n_samples = indptr.shape[0] - 1
      for i in range(n_samples):
          if heap[0][i, 0] < 0.0:
              for j in range(n_neighbors - np.sum(heap[0][i] >= 0.0)):
                  idx = np.abs(tau_rand_int(rng_state)) % n_samples
  
                  from_inds = inds[indptr[idx] : indptr[idx + 1]]
                  from_data = data[indptr[idx] : indptr[idx + 1]]
  
                  to_inds = inds[indptr[i] : indptr[i + 1]]
                  to_data = data[indptr[i] : indptr[i + 1]]
                  d = dist(from_inds, from_data, to_inds, to_data)
  
                  checked_flagged_heap_push(
                      heap[1][i],
                      heap[0][i],
                      heap[2][i],
                      d,
                      idx,
                      np.uint8(1),
                  )
  
      return
  
file_path: pynndescent/pynndescent/sparse_nndescent.py
imports: from __future__ import print_function
  import locale
  import numpy
  import numba
  from pynndescent.utils import tau_rand_int, make_heap, new_build_candidates, deheap_sort, checked_flagged_heap_push, apply_graph_updates_high_memory, apply_graph_updates_low_memory
  from pynndescent.sparse import sparse_euclidean
label_desc: Use image node_id 3 for calling a global function with example usage: init_random(n_neighbors, inds, indptr, data, heap, dist, rng_state) without return types