code: def test_redundant_bins(strategy, expected_bin_edges):
      X = [[0], [0], [0], [0], [3], [3]]
      kbd = KBinsDiscretizer(n_bins=3, strategy=strategy)
      warning_message = "Consider decreasing the number of bins."
      with pytest.warns(UserWarning, match=warning_message):
          kbd.fit(X)
      assert_array_almost_equal(kbd.bin_edges_[0], expected_bin_edges)
  
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 16 for calling a global function with example usage: test_redundant_bins(strategy, expected_bin_edges) without return types