code: def test_ExplainWaterfallPlot(display_rows, monkeypatch):
      state = AnalysisState()
      state.explain = {
          "shapley": [
              AnalysisState(
                  row="row",
                  expected_value="expected_value",
                  shap_values="shap_values",
                  features=pd.DataFrame(
                      {"feature_names": ["features"]}
                  ),
                  feature_names="feature_names",
              )
          ]
      }
      with monkeypatch.context() as m:
          call_shap_waterfall_plot = MagicMock()
          call_shap_explanation = MagicMock(
              return_value="explanation_mock"
          )
          call_display_obj = MagicMock()
          m.setattr("shap.waterfall_plot", call_shap_waterfall_plot)
          m.setattr("shap.Explanation", call_shap_explanation)
          m.setattr(JupyterMixin, "display_obj", call_display_obj)
  
          ExplainWaterfallPlot(
              display_rows=display_rows, extra_arg="extra_arg"
          ).render(state)
  
          if display_rows:
              call_display_obj.assert_called_with("row")
          else:
              call_display_obj.assert_not_called()
  
          call_shap_waterfall_plot.assert_called_with(
              "explanation_mock"
          )
  
          assert call_shap_explanation.call_args.args == (
              "shap_values",
          )
          kwargs = call_shap_explanation.call_args.kwargs
          output_names = kwargs.pop("output_names")
          assert output_names.equals(
              pd.DataFrame({"feature_names": ["features"]})
          )
          assert kwargs == dict(
              base_values="expected_value",
              feature_names=RangeIndex(start=0, stop=1, step=1),
          )
  
file_path: autogluon/eda/tests/unittests/visualization/test_explain.py
imports: from unittest.mock import MagicMock, call
  import numpy
  import pandas
  import pytest
  from pandas import RangeIndex
  from autogluon.eda import AnalysisState
  from autogluon.eda.visualization import ExplainForcePlot, ExplainWaterfallPlot
  from autogluon.eda.visualization.jupyter import JupyterMixin
label_desc: Use image node_id 2 for calling a global function with example usage: test_ExplainWaterfallPlot(display_rows, monkeypatch) without return types