code: def test_predict_and_score(dataset, datatype, parameters, client):
      n_neighbors, n_parts, batch_size = parameters
      X_train, X_test, y_train, y_test = dataset
  
      l_model = lKNNClf(n_neighbors=n_neighbors)
      l_model.fit(X_train, y_train)
      l_outputs = l_model.predict(X_test)
      handmade_local_score = np.mean(y_test == l_outputs)
      handmade_local_score = round(handmade_local_score, 3)
  
      X_train = generate_dask_array(X_train, n_parts)
      X_test = generate_dask_array(X_test, n_parts)
      y_train = generate_dask_array(y_train, n_parts)
      y_test = generate_dask_array(y_test, n_parts)
  
      if datatype == "dask_cudf":
          X_train = to_dask_cudf(X_train, client)
          X_test = to_dask_cudf(X_test, client)
          y_train = to_dask_cudf(y_train, client)
          y_test = to_dask_cudf(y_test, client)
  
      d_model = dKNNClf(
          client=client, n_neighbors=n_neighbors, batch_size=batch_size
      )
      d_model.fit(X_train, y_train)
      d_outputs = d_model.predict(X_test, convert_dtype=True)
      d_outputs = d_outputs.compute()
  
      d_outputs = (
          d_outputs.to_numpy()
          if isinstance(d_outputs, DataFrame)
          else d_outputs
      )
  
      exact_match(l_outputs, d_outputs)
  
      distributed_score = d_model.score(X_test, y_test)
      distributed_score = round(distributed_score, 3)
      assert distributed_score == pytest.approx(
          handmade_local_score, abs=1e-2
      )
  
file_path: cuml/python/cuml/tests/dask/test_dask_kneighbors_classifier.py
imports: from cuml.internals.safe_imports import gpu_only_import
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  from cuml.testing.utils import unit_param, quality_param, stress_param
  from cuml.neighbors import KNeighborsClassifier
  from cuml.dask.neighbors import KNeighborsClassifier
  from sklearn.datasets import make_multilabel_classification
  from sklearn.datasets import make_classification
  from sklearn.model_selection import train_test_split
  import dask.array
  import dask.dataframe
  from cuml.dask.common.dask_arr_utils import to_dask_cudf
  from cuml.internals.safe_imports import gpu_only_import_from
label_desc: Use image node_id 5 for calling a global function with example usage: test_predict_and_score(dataset, datatype, parameters, client) without return types