code: def test_FeatureImportance(monkeypatch, show_barplots):
      state = AnalysisState(
          {
              "model_evaluation": {
                  "importance": pd.DataFrame(
                      {
                          "importance": [0.1, 0.2, 0.3],
                          "stddev": [0.01, 0.02, 0.03],
                          "p_value": [0.1, 0.2, 0.3],
                          "n": [5, 5, 5],
                          "p99_high": [0.02, 0.03, 0.04],
                          "p99_low": [-0.02, -0.03, -0.04],
                      }
                  ),
              }
          }
      )
  
      call_plt_subplots = MagicMock(return_value=("fig", "ax"))
      call_plt_show = MagicMock()
      call_sns_barplot = MagicMock()
      call_display_obj = MagicMock()
      call_render_markdown = MagicMock()
      with monkeypatch.context() as m:
          m.setattr(plt, "subplots", call_plt_subplots)
          m.setattr(plt, "show", call_plt_show)
          m.setattr(sns, "barplot", call_sns_barplot)
          viz = FeatureImportance(
              headers=True,
              show_barplots=show_barplots,
              fig_args=dict(a=1, b=2),
              some_kwarg=123,
          )
          viz.display_obj = call_display_obj
          viz.render_markdown = call_render_markdown
          viz.render(state)
      call_display_obj.assert_called_once()
      call_render_markdown.assert_called_with("**Feature Importance**")
      if show_barplots:
          call_plt_subplots.assert_called_with(
              a=1, b=2, figsize=(12, 0.75)
          )
          call_plt_show.assert_called_with("fig")
          call_sns_barplot.assert_called_with(
              ax="ax",
              data=ANY,
              y="index",
              x="importance",
              some_kwarg=123,
          )
      else:
          call_plt_subplots.assert_not_called()
          call_plt_show.assert_not_called()
          call_sns_barplot.assert_not_called()
  
file_path: autogluon/eda/tests/unittests/visualization/test_model.py
imports: from unittest.mock import ANY, MagicMock
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  import seaborn
  from autogluon.eda import AnalysisState
  from autogluon.eda.visualization import ConfusionMatrix, FeatureImportance, ModelLeaderboard, RegressionEvaluation
label_desc: Use image node_id 9 for calling a global function with example usage: test_FeatureImportance(monkeypatch, show_barplots) without return types