code: def test_nonuniform_strategies(
      strategy, expected_2bins, expected_3bins, expected_5bins
  ):
      X = np.array([0, 0.5, 2, 3, 9, 10]).reshape(-1, 1)
  
      # with 2 bins
      est = KBinsDiscretizer(
          n_bins=2, strategy=strategy, encode="ordinal"
      )
      Xt = est.fit_transform(X)
      assert_array_equal(expected_2bins, Xt.ravel())
  
      # with 3 bins
      est = KBinsDiscretizer(
          n_bins=3, strategy=strategy, encode="ordinal"
      )
      Xt = est.fit_transform(X)
      assert_array_equal(expected_3bins, Xt.ravel())
  
      # with 5 bins
      est = KBinsDiscretizer(
          n_bins=5, strategy=strategy, encode="ordinal"
      )
      Xt = est.fit_transform(X)
      assert_array_equal(expected_5bins, Xt.ravel())
  
imports: import warnings
  import numpy
  import pytest
  import scipy.sparse
  from sklearn import clone
  from sklearn.preprocessing import KBinsDiscretizer, OneHotEncoder
  from sklearn.utils._testing import assert_allclose, assert_allclose_dense_sparse, assert_array_almost_equal, assert_array_equal
label_desc: Use image node_id 12 for calling a global function with example usage: test_nonuniform_strategies(strategy, expected_2bins, expected_3bins, expected_5bins) without return types