code: def test_nearest_neighbors_rbc(distance_dims, n_neighbors, nrows):
      distance, dims = distance_dims
  
      X, y = make_blobs(
          n_samples=nrows,
          centers=25,
          shuffle=True,
          n_features=dims,
          cluster_std=3.0,
          random_state=42,
      )
  
      knn_cu = cuKNN(metric=distance, algorithm="rbc")
      knn_cu.fit(X)
  
      query_rows = int(nrows / 2)
  
      rbc_d, rbc_i = knn_cu.kneighbors(
          X[:query_rows, :], n_neighbors=n_neighbors
      )
  
      if distance == "euclidean":
          # Need to use unexpanded euclidean distance
          pw_dists = cuPW(X, metric="l2")
          brute_i = cp.argsort(pw_dists, axis=1)[
              :query_rows, :n_neighbors
          ]
          brute_d = cp.sort(pw_dists, axis=1)[:query_rows, :n_neighbors]
      else:
          knn_cu_brute = cuKNN(metric=distance, algorithm="brute")
          knn_cu_brute.fit(X)
  
          brute_d, brute_i = knn_cu_brute.kneighbors(
              X[:query_rows, :], n_neighbors=n_neighbors
          )
  
      assert len(brute_d[brute_d != rbc_d]) == 0
  
      # All the distances match so allow a couple mismatched indices
      # through from potential non-determinism in exact matching
      # distances
      assert len(brute_i[brute_i != rbc_i]) <= 3
  
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 16 for calling a global function with example usage: test_nearest_neighbors_rbc(distance_dims, n_neighbors, nrows) without return types