code: def test_parameter_check(params, error, err_msg):
      """Test parameter validation."""
      discretizer = KBinsDiscretizer(**params)
      with pytest.raises(error, match=re.escape(err_msg)):
          discretizer.transform(X)
  
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 4 for calling a global function with example usage: test_parameter_check(params, error, err_msg) without return types