code: def test__plot_hbar_n_cols(n_axes, n_cols, exp_importance):
      """Test if the number of axes columns matches the expectation."""
      n_rows = n_axes // n_cols + (n_axes % n_cols != 0)
      targets = np.random.choice(
          len(
              exp_importance.meta["params"]["target_names"],
          ),
          size=n_axes,
          replace=True,
      )
      features = np.arange(
          len(exp_importance.meta["params"]["feature_names"])
      ).tolist()
  
      # create the horizontal bar plot
      ax = _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,
          n_cols=n_cols,
      )
  
      assert ax.shape == (n_rows, n_cols)
      assert np.sum(~pd.isna(ax.ravel())) == n_axes
  
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 17 for calling a global function with example usage: test__plot_hbar_n_cols(n_axes, n_cols, exp_importance) without return types