code: def test__plot_hbar_ax(exp_importance):
      """Test if an error is raised when the number of provided axes is less than the number of targets
      to plot the horizontal bar for."""
      n_targets = 7
      targets = np.random.choice(
          len(exp_importance.meta["params"]["target_names"]),
          size=n_targets,
          replace=True,
      )
      features = np.arange(
          len(exp_importance.meta["params"]["feature_names"])
      ).tolist()
      _, ax = plt.subplots(nrows=2, ncols=2)
  
      with pytest.raises(ValueError) as err:
          _plot_hbar(
              exp_values=exp_importance.data["feature_importance"],
              exp_feature_names=exp_importance.data["feature_names"],
              exp_target_names=exp_importance.meta["params"][
                  "target_names"
              ],
              features=features,
              targets=targets,
              ax=ax,
          )
  
      assert "Expected ax to have" in str(err.value)
  
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 18 for calling a global function with example usage: test__plot_hbar_ax(exp_importance) without return types