code: def test_display_curve_n_samples_consistency(
      pyplot, data_binary, Display
  ):
      """Check the error raised when `y_pred` or `sample_weight` have inconsistent
      length."""
      X, y = data_binary
      classifier = DecisionTreeClassifier().fit(X, y)
  
      msg = "Found input variables with inconsistent numbers of samples"
      with pytest.raises(ValueError, match=msg):
          Display.from_estimator(classifier, X[:-2], y)
      with pytest.raises(ValueError, match=msg):
          Display.from_estimator(classifier, X, y[:-2])
      with pytest.raises(ValueError, match=msg):
          Display.from_estimator(
              classifier, X, y, sample_weight=np.ones(X.shape[0] - 2)
          )
  
imports: import numpy
  import pytest
  from sklearn.base import ClassifierMixin, clone
  from sklearn.calibration import CalibrationDisplay
  from sklearn.compose import make_column_transformer
  from sklearn.datasets import load_iris
  from sklearn.exceptions import NotFittedError
  from sklearn.linear_model import LogisticRegression
  from sklearn.metrics import ConfusionMatrixDisplay, DetCurveDisplay, PrecisionRecallDisplay, PredictionErrorDisplay, RocCurveDisplay
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import StandardScaler
  from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
label_desc: Use image node_id 8 for calling a global function with example usage: test_display_curve_n_samples_consistency(pyplot, data_binary, Display) without return types