code: def test_kbinsdiscretizer(
      failure_logger,
      blobs_dataset,
      n_bins,
      encode,
      strategy,  # noqa: F811
  ):
      X_np, X = blobs_dataset
  
      transformer = cuKBinsDiscretizer(
          n_bins=n_bins, encode=encode, strategy=strategy
      )
      t_X = transformer.fit_transform(X)
      r_X = transformer.inverse_transform(t_X)
  
      if encode != "onehot":
          assert type(t_X) == type(X)
          assert type(r_X) == type(t_X)
  
      transformer = skKBinsDiscretizer(
          n_bins=n_bins, encode=encode, strategy=strategy
      )
      sk_t_X = transformer.fit_transform(X_np)
      sk_r_X = transformer.inverse_transform(sk_t_X)
  
      if strategy == "kmeans":
          assert_allclose(t_X, sk_t_X, ratio_tol=0.2)
      else:
          assert_allclose(t_X, sk_t_X)
          assert_allclose(r_X, sk_r_X)
  
imports: from cuml.internals.safe_imports import gpu_only_import
  import pytest
  import sklearn
  from cuml.preprocessing import Binarizer, FunctionTransformer, KBinsDiscretizer, KernelCenterer, MaxAbsScaler, MinMaxScaler, MissingIndicator, Normalizer, PolynomialFeatures, PowerTransformer, QuantileTransformer, RobustScaler, SimpleImputer, StandardScaler
  from cuml.preprocessing import add_dummy_feature, binarize, maxabs_scale, minmax_scale, normalize, power_transform, quantile_transform, robust_scale, scale
  from sklearn.preprocessing import Binarizer, FunctionTransformer, KBinsDiscretizer, KernelCenterer, MaxAbsScaler, MinMaxScaler, Normalizer, PolynomialFeatures, PowerTransformer, QuantileTransformer, RobustScaler, StandardScaler
  from sklearn.preprocessing import add_dummy_feature, binarize, maxabs_scale, minmax_scale, normalize, power_transform, quantile_transform, robust_scale, scale
  from sklearn.impute import MissingIndicator, SimpleImputer
  from cuml.testing.test_preproc_utils import clf_dataset, int_dataset, blobs_dataset, nan_filled_positive, sparse_nan_filled_positive, sparse_clf_dataset, sparse_blobs_dataset, sparse_int_dataset, sparse_imputer_dataset, sparse_dataset_with_coo
  from cuml.testing.test_preproc_utils import assert_allclose
  from cuml.metrics import pairwise_kernels
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 28 for calling a global function with example usage: test_kbinsdiscretizer(failure_logger, blobs_dataset, n_bins, encode, strategy) without return types