code: def test_knn_separate_index_search(
      input_type, nrows, n_feats, k, metric
  ):
      X, _ = make_blobs(
          n_samples=nrows, n_features=n_feats, random_state=0
      )
  
      X_index = X[:100]
      X_search = X[101:]
  
      p = 5  # Testing 5-norm of the minkowski metric only
      knn_sk = skKNN(metric=metric, p=p)  # Testing
      knn_sk.fit(X_index.get())
      D_sk, I_sk = knn_sk.kneighbors(X_search.get(), k)
  
      X_orig = X_index
  
      if input_type == "dataframe":
          X_index = cudf.DataFrame(X_index)
          X_search = cudf.DataFrame(X_search)
  
      knn_cu = cuKNN(metric=metric, p=p)
      knn_cu.fit(X_index)
      D_cuml, I_cuml = knn_cu.kneighbors(X_search, k)
  
      if input_type == "dataframe":
          assert isinstance(D_cuml, cudf.DataFrame)
          assert isinstance(I_cuml, cudf.DataFrame)
          D_cuml_np = D_cuml.to_numpy()
          I_cuml_np = I_cuml.to_numpy()
      else:
          assert isinstance(D_cuml, cp.ndarray)
          assert isinstance(I_cuml, cp.ndarray)
          D_cuml_np = D_cuml.get()
          I_cuml_np = I_cuml.get()
  
      with cuml.using_output_type("numpy"):
          # Assert the cuml model was properly reverted
          np.testing.assert_allclose(
              knn_cu._fit_X, X_orig.get(), atol=1e-3, rtol=1e-3
          )
  
      if metric == "braycurtis":
          diff = D_cuml_np - D_sk
          # Braycurtis has a few differences, but this is computed by FAISS.
          # So long as the indices all match below, the small discrepancy
          # should be okay.
          assert len(diff[diff > 1e-2]) / X_search.shape[0] < 0.06
      else:
          np.testing.assert_allclose(
              D_cuml_np, D_sk, atol=1e-3, rtol=1e-3
          )
      assert I_cuml_np.all() == I_sk.all()
  
imports: import gc
  from cuml.common import has_scipy
  import cuml
  import sklearn
  from cuml.internals.safe_imports import cpu_only_import_from
  from numpy.testing import assert_array_equal, assert_allclose
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  import math
  from cuml.testing.utils import array_equal, unit_param, quality_param, stress_param
  from cuml.neighbors import NearestNeighbors
  from sklearn.neighbors import NearestNeighbors
  from cuml.datasets import make_blobs
  from sklearn.metrics import pairwise_distances
  from cuml.metrics import pairwise_distances
  from cuml.internals import logger
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 11 for calling a global function with example usage: test_knn_separate_index_search(input_type, nrows, n_feats, k, metric) without return types