code: def test_tree_no_split(small_data, sparse_small_data, metric):
      k = 10
      for data, data_type in zip(
          [small_data, sparse_small_data], ["dense", "sparse"]
      ):
          n_instances = data.shape[0]
          leaf_size = n_instances + 1  # just to be safe
          data_train = data[n_instances // 2 :]
          data_test = data[: n_instances // 2]
  
          nnd = NNDescent(
              data_train,
              metric=metric,
              n_neighbors=data_train.shape[0] - 1,
              random_state=None,
              tree_init=True,
              leaf_size=leaf_size,
          )
          nnd.prepare()
          knn_indices, _ = nnd.query(data_test, k=k, epsilon=0.2)
  
          true_nnd = NearestNeighbors(metric=metric).fit(data_train)
          true_indices = true_nnd.kneighbors(
              data_test, k, return_distance=False
          )
  
          num_correct = 0.0
          for i in range(true_indices.shape[0]):
              num_correct += np.sum(
                  np.in1d(true_indices[i], knn_indices[i])
              )
  
          percent_correct = num_correct / (true_indices.shape[0] * k)
          assert (
              percent_correct >= 0.95
          ), "NN-descent query did not get 95% for accuracy on nearest neighbors on {} data".format(
              data_type
          )
  
imports: import os
  import io
  import re
  import pytest
  from contextlib import redirect_stdout
  import numpy
  from sklearn.neighbors import KDTree
  from sklearn.neighbors import NearestNeighbors
  from sklearn.preprocessing import normalize
  import pickle
  import joblib
  import scipy
  from pynndescent import NNDescent, PyNNDescentTransformer
label_desc: Use image node_id 31 for calling a global function with example usage: test_tree_no_split(small_data, sparse_small_data, metric) without return types