code: def test_categorical_parameters(
      is_categorical, known_categories, match
  ):
      # test the validation of the is_categorical and known_categories parameters
  
      X = np.array([[1, 2, 3]], dtype=X_DTYPE)
  
      bin_mapper = _BinMapper(
          is_categorical=is_categorical,
          known_categories=known_categories,
      )
      with pytest.raises(ValueError, match=match):
          bin_mapper.fit(X)
  
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from sklearn.ensemble._hist_gradient_boosting.binning import _BinMapper, _find_binning_thresholds, _map_to_bins
  from sklearn.ensemble._hist_gradient_boosting.common import ALMOST_INF, X_BINNED_DTYPE, X_DTYPE
  from sklearn.utils._openmp_helpers import _openmp_effective_n_threads
label_desc: Use image node_id 22 for calling a global function with example usage: test_categorical_parameters(is_categorical, known_categories, match) without return types