code: def _daal4py_k_means_predict(
      X, nClusters, centroids, resultsToEvaluate="computeAssignments"
  ):
      X_fptype = getFPType(X)
      kmeans_algo = _daal4py_kmeans_compatibility(
          nClusters=nClusters,
          maxIterations=0,
          fptype=X_fptype,
          resultsToEvaluate=resultsToEvaluate,
          method="defaultDense",
      )
  
      res = kmeans_algo.compute(X, centroids)
  
      return res.assignments[:, 0], res.objectiveFunction[0, 0]
  
imports: import numpy
  from scipy import sparse
  from sklearn.utils import check_array, check_random_state
  from sklearn.utils.sparsefuncs import mean_variance_axis
  from sklearn.utils.validation import _num_samples, check_is_fitted
  import warnings
  from sklearn.cluster import KMeans
  from sklearn.utils.extmath import row_norms
  import daal4py
  from .._device_offload import support_usm_ndarray
  from .._utils import PatchingConditionsChain, control_n_jobs, daal_check_version, getFPType, run_with_n_jobs
label_desc: Use image node_id 4 for calling a global function with example usage: _daal4py_k_means_predict(X, nClusters, centroids, resultsToEvaluate) and returns: res,  res