code: def test_feature_importances(with_std, with_value):
      expl = Explanation(
          estimator="some estimator",
          feature_importances=FeatureImportances(
              importances=[
                  FeatureWeight(
                      "a",
                      1,
                      std=0.1 if with_std else None,
                      value=1 if with_value else None,
                  ),
                  FeatureWeight(
                      "b",
                      2,
                      std=0.2 if with_std else None,
                      value=3 if with_value else None,
                  ),
              ],
              remaining=10,
          ),
      )
      df_dict = format_as_dataframes(expl)
      assert isinstance(df_dict, dict)
      assert list(df_dict) == ["feature_importances"]
      df = df_dict["feature_importances"]
      expected_df = pd.DataFrame(
          {"feature": ["a", "b"], "weight": [1, 2]},
          columns=["feature", "weight"],
      )
      if with_std:
          expected_df["std"] = [0.1, 0.2]
      if with_value:
          expected_df["value"] = [1, 3]
      print(df, expected_df, sep="\n")
      assert expected_df.equals(df)
  
      single_df = format_as_dataframe(expl)
      assert expected_df.equals(single_df)
  
file_path: eli5/tests/test_formatters_as_dataframe.py
imports: from __future__ import print_function
  from itertools import chain
  import pytest
  import numpy
  from sklearn.linear_model import LinearRegression
  from sklearn.ensemble import ExtraTreesRegressor
  from eli5 import format_as_dataframes, format_as_dataframe, explain_weights_df, explain_weights_dfs, explain_prediction_df, explain_prediction_dfs, format_as_text, explain_weights, explain_prediction
  from eli5.base import Explanation, TargetExplanation, FeatureWeight, FeatureWeights, FeatureImportances, TransitionFeatureWeights
label_desc: Use image node_id 8 for calling a global function with example usage: test_feature_importances(with_std, with_value) without return types