code: def test_transform(
      nrows, ncols, nclusters, n_parts, 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,
          shuffle=False,
          random_state=10,
      )
      y = y.astype("int64")
  
      if input_type == "dataframe":
          X_train = to_dask_cudf(X)
          y_train = to_dask_cudf(y)
          labels = y_train.compute().values
      elif input_type == "array":
          X_train, y_train = X, y
          labels = cp.squeeze(y_train.compute())
  
      cumlModel = cumlKMeans(
          init="k-means||", n_clusters=nclusters, random_state=10
      )
  
      cumlModel.fit(X_train)
  
      xformed = cumlModel.transform(X_train).compute()
      if input_type == "dataframe":
          xformed = cp.array(
              xformed if len(xformed.shape) == 1 else xformed.to_cupy()
          )
  
      if nclusters == 1:
          # series shape is (nrows,) not (nrows, 1) but both are valid
          # and equivalent for this test
          assert xformed.shape in [(nrows, nclusters), (nrows,)]
      else:
          assert xformed.shape == (nrows, nclusters)
  
      # The argmin of the transformed values should be equal to the labels
      # reshape is a quick manner of dealing with (nrows,) is not (nrows, 1)
      xformed_labels = cp.argmin(
          xformed.reshape((int(nrows), int(nclusters))), axis=1
      )
  
      assert sk_adjusted_rand_score(
          cp.asnumpy(labels), cp.asnumpy(xformed_labels)
      )
  
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 4 for calling a global function with example usage: test_transform(nrows, ncols, nclusters, n_parts, input_type, client) without return types