code: def test_compare_skl(
      nrows,
      ncols,
      nclusters,
      n_parts,
      n_neighbors,
      streams_per_handle,
      reverse_worker_order,
      client,
  ):
      from cuml.dask.neighbors import NearestNeighbors as daskNN
  
      from sklearn.datasets import make_blobs
  
      nrows = _scale_rows(client, nrows)
  
      X, y = make_blobs(
          n_samples=int(nrows),
          n_features=ncols,
          centers=nclusters,
          random_state=0,
      )
      X = X.astype(np.float32)
  
      X_cudf = _prep_training_data(
          client, X, n_parts, reverse_worker_order
      )
  
      from dask.distributed import wait
  
      wait(X_cudf)
  
      dist = np.array([len(v) for v in client.has_what().values()])
  
      assert np.all(dist == dist[0])
  
      cumlModel = daskNN(
          n_neighbors=n_neighbors, streams_per_handle=streams_per_handle
      )
      cumlModel.fit(X_cudf)
  
      out_d, out_i = cumlModel.kneighbors(X_cudf)
  
      local_i = np.array(out_i.compute().to_numpy(), dtype="int64")
  
      sklModel = KNeighborsClassifier(n_neighbors=n_neighbors).fit(X, y)
      skl_y_hat = sklModel.predict(X)
      y_hat, _ = predict(local_i, y, n_neighbors)
  
      sk_d, sk_i = sklModel.kneighbors(X)
  
      sk_i = sk_i.astype("int64")
  
      assert array_equal(local_i[:, 0], np.arange(nrows))
  
      diff = sk_i - local_i
      n_diff = len(diff[diff > 0])
  
      perc_diff = n_diff / (nrows * n_neighbors)
  
      assert perc_diff <= 3e-3
  
      assert array_equal(y_hat, skl_y_hat)
  
file_path: cuml/python/cuml/tests/dask/test_dask_nearest_neighbors.py
imports: import platform
  from cuml.testing.utils import array_equal
  from sklearn.neighbors import KNeighborsClassifier
  from cuml.testing.utils import unit_param, quality_param, stress_param
  from cuml.dask.common import utils
  from cuml.common import has_scipy
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 4 for calling a global function with example usage: test_compare_skl(nrows, ncols, nclusters, n_parts, n_neighbors, streams_per_handle, reverse_worker_order, client) without return types