code: def test_partial_dependence_display_wrong_len_kind(
      pyplot,
      clf_diabetes,
      diabetes,
  ):
      """Check that we raise an error when `kind` is a list with a wrong length.
  
      This case can only be triggered using the `PartialDependenceDisplay.from_estimator`
      method.
      """
      disp = PartialDependenceDisplay.from_estimator(
          clf_diabetes,
          diabetes.data,
          features=[0, 2],
          grid_resolution=20,
          kind="average",  # len(kind) != len(features)
      )
  
      # alter `kind` to be a list with a length different from length of `features`
      disp.kind = ["average"]
      err_msg = (
          r"When `kind` is provided as a list of strings, it should contain as many"
          r" elements as `features`. `kind` contains 1 element\(s\) and `features`"
          r" contains 2 element\(s\)."
      )
      with pytest.raises(ValueError, match=err_msg):
          disp.plot()
  
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose
  from scipy.stats.mstats import mquantiles
  from sklearn.compose import make_column_transformer
  from sklearn.datasets import load_diabetes, load_iris, make_classification, make_regression
  from sklearn.ensemble import GradientBoostingClassifier, GradientBoostingRegressor
  from sklearn.inspection import PartialDependenceDisplay
  from sklearn.linear_model import LinearRegression
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import OneHotEncoder
  from sklearn.utils._testing import _convert_container
label_desc: Use image node_id 27 for calling a global function with example usage: test_partial_dependence_display_wrong_len_kind(pyplot, clf_diabetes, diabetes) without return types