code: def test_explain_weights_feature_names_pandas(boston_train):
      pd = pytest.importorskip("pandas")
      X, y, feature_names = boston_train
      df = pd.DataFrame(X, columns=feature_names)
      reg = LGBMRegressor().fit(df, y)
  
      # it shoud pick up feature names from DataFrame columns
      res = explain_weights(reg)
      for expl in format_as_all(res, reg):
          assert "PTRATIO" in expl
  
      # it is possible to override DataFrame feature names
      numeric_feature_names = [
          "zz%s" % idx for idx in range(len(feature_names))
      ]
      res = explain_weights(reg, feature_names=numeric_feature_names)
      for expl in format_as_all(res, reg):
          assert "zz12" in expl
  
imports: from __future__ import absolute_import
  import pytest
  import numpy
  from sklearn.feature_extraction.text import CountVectorizer
  from lightgbm import LGBMClassifier, LGBMRegressor
  from eli5 import explain_weights, explain_prediction
  from .test_sklearn_explain_weights import test_explain_tree_classifier, test_explain_random_forest_and_tree_feature_filter, test_feature_importances_no_remaining, test_explain_tree_regressor
  from .test_sklearn_explain_prediction import assert_linear_regression_explained, test_explain_prediction_pandas, test_explain_clf_binary_iris
  from .utils import format_as_all, check_targets_scores, get_all_features
label_desc: Use image node_id 12 for calling a global function with example usage: test_explain_weights_feature_names_pandas(boston_train) without return types