code: def test_end_to_end(
      nrows,
      ncols,
      nclusters,
      n_parts,
      delayed_predict,
      input_type,
      client,
  ):
      from cuml.dask.cluster import KMeans as cumlKMeans
  
      from cuml.dask.datasets import make_blobs
  
      X, y = make_blobs(
          n_samples=int(nrows),
          n_features=ncols,
          centers=nclusters,
          n_parts=n_parts,
          cluster_std=0.01,
          random_state=10,
      )
  
      if input_type == "dataframe":
          X_train = to_dask_cudf(X)
          y_train = to_dask_cudf(y)
      elif input_type == "array":
          X_train, y_train = X, y
  
      cumlModel = cumlKMeans(
          init="k-means||", n_clusters=nclusters, random_state=10
      )
  
      cumlModel.fit(X_train)
      cumlLabels = cumlModel.predict(X_train, delayed=delayed_predict)
  
      n_workers = len(list(client.has_what().keys()))
  
      # Verifying we are grouping partitions. This should be changed soon.
      if n_parts is not None:
          parts_len = n_parts
      else:
          parts_len = n_workers
  
      if input_type == "dataframe":
          assert cumlLabels.npartitions == parts_len
          cumlPred = cumlLabels.compute().values
          labels = y_train.compute().values
      elif input_type == "array":
          assert len(cumlLabels.chunks[0]) == parts_len
          cumlPred = cp.array(cumlLabels.compute())
          labels = cp.squeeze(y_train.compute())
  
      assert cumlPred.shape[0] == nrows
      assert cp.max(cumlPred) == nclusters - 1
      assert cp.min(cumlPred) == 0
  
      score = adjusted_rand_score(labels, cumlPred)
  
      assert 1.0 == score
  
file_path: cuml/python/cuml/tests/dask/test_dask_kmeans.py
imports: from cuml.dask.common.dask_arr_utils import to_dask_cudf
  from sklearn.metrics import adjusted_rand_score
  from cuml.metrics import adjusted_rand_score
  import dask.array
  from cuml.testing.utils import stress_param
  from cuml.testing.utils import quality_param
  from cuml.testing.utils import unit_param
  import pytest
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 1 for calling a global function with example usage: test_end_to_end(nrows, ncols, nclusters, n_parts, delayed_predict, input_type, client) without return types