code: def test_warning_smaller_n_bins():
      """Test that a warning is raised when n_bins will be smaller."""
      X_new = np.r_[np.zeros((1, n_timestamps)), X]
      discretizer = KBinsDiscretizer()
      warning_msg = (
          "Some quantiles are equal. The number of bins will be "
          "smaller for sample {0}. Consider decreasing the number "
          "of bins or removing these samples.".format([0])
      )
      with pytest.warns(UserWarning, match=re.escape(warning_msg)):
          discretizer._compute_bins(
              X_new, n_samples + 1, n_bins=5, strategy="quantile"
          )
  
file_path: pyts/pyts/preprocessing/tests/test_discretizer.py
imports: import numpy
  import pytest
  import re
  from pyts.preprocessing.discretizer import _uniform_bins, _digitize, _reshape_with_nan
  from pyts.preprocessing import KBinsDiscretizer
label_desc: Use image node_id 5 for calling a global function with example usage: test_warning_smaller_n_bins() without return types