code: def test_invalid_features(method, features):
      """Tests whether an invalid list of features raises an error."""
      explainer = PartialDependenceVariance(
          predictor=lambda x: np.empty((len(x),))
      )
      with pytest.raises(ValueError) as err:
          explainer.explain(
              X=np.empty((10, 3)), method=method, features=features
          )
      msg = (
          "all features must be integers"
          if method == "importance"
          else "all features must be tuples of length 2"
      )
      assert re.search(msg, err.value.args[0].lower())
  
imports: import re
  from copy import deepcopy
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  from pytest_lazyfixture import lazy_fixture
  from sklearn.ensemble import GradientBoostingRegressor
  from sklearn.linear_model import LinearRegression
  from alibi.api.defaults import DEFAULT_DATA_PDVARIANCE, DEFAULT_META_PDVARIANCE
  from alibi.api.interfaces import Explanation
  from alibi.explainers import PartialDependence, PartialDependenceVariance, TreePartialDependence
  from alibi.explainers.pd_variance import _plot_feature_importance, _plot_feature_interaction, _plot_hbar, plot_pd_variance
label_desc: Use image node_id 4 for calling a global function with example usage: test_invalid_features(method, features) without return types