code: def nn_descent(
      inds,
      indptr,
      data,
      n_neighbors,
      rng_state,
      max_candidates=50,
      dist=sparse_euclidean,
      n_iters=10,
      delta=0.001,
      init_graph=EMPTY_GRAPH,
      rp_tree_init=True,
      leaf_array=None,
      low_memory=False,
      verbose=False,
  ):
      n_samples = indptr.shape[0] - 1
  
      if init_graph[0].shape[0] == 1:  # EMPTY_GRAPH
          current_graph = make_heap(n_samples, n_neighbors)
  
          if rp_tree_init:
              init_rp_tree(
                  inds, indptr, data, dist, current_graph, leaf_array
              )
  
          init_random(
              n_neighbors,
              inds,
              indptr,
              data,
              current_graph,
              dist,
              rng_state,
          )
      elif (
          init_graph[0].shape[0] == n_samples
          and init_graph[0].shape[1] == n_neighbors
      ):
          current_graph = init_graph
      else:
          raise ValueError("Invalid initial graph specified!")
  
      if low_memory:
          nn_descent_internal_low_memory_parallel(
              current_graph,
              inds,
              indptr,
              data,
              n_neighbors,
              rng_state,
              max_candidates=max_candidates,
              dist=dist,
              n_iters=n_iters,
              delta=delta,
              verbose=verbose,
          )
      else:
          nn_descent_internal_high_memory_parallel(
              current_graph,
              inds,
              indptr,
              data,
              n_neighbors,
              rng_state,
              max_candidates=max_candidates,
              dist=dist,
              n_iters=n_iters,
              delta=delta,
              verbose=verbose,
          )
  
      return deheap_sort(current_graph[0], current_graph[1])
  
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 7 for calling a global function with example usage: nn_descent(inds, indptr, data, n_neighbors, rng_state, max_candidates, dist, n_iters, delta, init_graph, rp_tree_init, leaf_array, low_memory, verbose) and returns: deheap_sort