code: def test_linear_regression(num_features):
      """Test whether the order of the feature based on the feature importance is the one expected for a linear
      regression model."""
      X = np.random.uniform(low=-1, high=1, size=(100, num_features))
      w = np.random.randn(num_features)
  
      points = np.linspace(-1, 1, 21)
      grid_points = {i: points for i in range(num_features)}
  
      explainer = PartialDependenceVariance(predictor=lambda x: x @ w)
      exp = explainer.explain(
          X=X, method="importance", grid_points=grid_points
      )
  
      expected_order = np.argsort(np.abs(w))
      order = np.argsort(exp.data["feature_importance"][0])
      assert np.all(expected_order == order)
  
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 8 for calling a global function with example usage: test_linear_regression(num_features) without return types