code: def test_input_error():
      X = [[1, 2], [2, 3], [3, 4]]
      y = [0, 1, 2]
  
      gbdt = HistGradientBoostingRegressor(monotonic_cst=[1, 0, -1])
      with pytest.raises(
          ValueError,
          match=re.escape(
              "monotonic_cst has shape (3,) but the input data"
          ),
      ):
          gbdt.fit(X, y)
  
      for monotonic_cst in ([1, 3], [1, -3], [0.3, -0.7]):
          gbdt = HistGradientBoostingRegressor(
              monotonic_cst=monotonic_cst
          )
          expected_msg = re.escape(
              "must be an array-like of -1, 0 or 1. Observed values:"
          )
          with pytest.raises(ValueError, match=expected_msg):
              gbdt.fit(X, y)
  
      gbdt = HistGradientBoostingClassifier(monotonic_cst=[0, 1])
      with pytest.raises(
          ValueError,
          match="monotonic constraints are not supported for multiclass classification",
      ):
          gbdt.fit(X, y)
  
file_path: scikit-learn/sklearn/ensemble/_hist_gradient_boosting/tests/test_monotonic_contraints.py
imports: import re
  import numpy
  import pytest
  from sklearn.ensemble import HistGradientBoostingClassifier, HistGradientBoostingRegressor
  from sklearn.ensemble._hist_gradient_boosting.common import G_H_DTYPE, X_BINNED_DTYPE, MonotonicConstraint
  from sklearn.ensemble._hist_gradient_boosting.grower import TreeGrower
  from sklearn.ensemble._hist_gradient_boosting.histogram import HistogramBuilder
  from sklearn.ensemble._hist_gradient_boosting.splitting import Splitter, compute_node_value
  from sklearn.utils._openmp_helpers import _openmp_effective_n_threads
  from sklearn.utils._testing import _convert_container
label_desc: Use image node_id 8 for calling a global function with example usage: test_input_error() without return types