code: def test_self_neighboring(datatype, metric_p, nrows):
      """Test that searches using an indexed vector itself return sensible
      results for that vector
  
      For L2-derived metrics, this specifically exercises the slow high-precision
      mode used to correct for approximation errors in L2 computation during NN
      searches.
      """
      ncols = 1000
      n_clusters = 10
      n_neighbors = 3
  
      metric, p = metric_p
  
      if not has_scipy():
          pytest.skip(
              "Skipping test_self_neighboring because "
              + "Scipy is missing"
          )
  
      X, y = make_blobs(
          n_samples=nrows,
          centers=n_clusters,
          n_features=ncols,
          random_state=0,
      )
  
      if datatype == "dataframe":
          X = cudf.DataFrame(X)
  
      knn_cu = cuKNN(metric=metric, n_neighbors=n_neighbors)
      knn_cu.fit(X)
      neigh_dist, neigh_ind = knn_cu.kneighbors(
          X,
          n_neighbors=n_neighbors,
          return_distance=True,
          two_pass_precision=True,
      )
  
      if datatype == "dataframe":
          assert isinstance(neigh_ind, cudf.DataFrame)
          neigh_ind = neigh_ind.to_numpy()
          neigh_dist = neigh_dist.to_numpy()
      else:
          assert isinstance(neigh_ind, cp.ndarray)
          neigh_ind = neigh_ind.get()
          neigh_dist = neigh_dist.get()
  
      neigh_ind = neigh_ind[:, 0]
      neigh_dist = neigh_dist[:, 0]
  
      assert_array_equal(
          neigh_ind,
          np.arange(0, neigh_dist.shape[0]),
      )
      assert_allclose(
          neigh_dist,
          np.zeros(neigh_dist.shape, dtype=neigh_dist.dtype),
          atol=1e-4,
      )
  
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 5 for calling a global function with example usage: test_self_neighboring(datatype, metric_p, nrows) without return types