code: def test_simple_bar_with_cohorts_dict():
      """Ensure that bar plots supports dictionary of Explanations as input."""
      rs = np.random.RandomState(42)
      fig = plt.figure()
      shap.plots.bar(
          {
              "t1": shap.Explanation(
                  values=rs.randn(40, 5),
                  base_values=np.ones(40) * 0.5,
              ),
              "t2": shap.Explanation(
                  values=rs.randn(20, 5),
                  base_values=np.ones(20) * 0.5,
              ),
          },
          show=False,
      )
      plt.tight_layout()
      return fig
  
file_path: shap/tests/plots/test_bar.py
imports: import matplotlib.pyplot
  import numpy
  import pytest
  import shap
  from shap.utils._exceptions import DimensionError
label_desc: Use image node_id 4 for calling a global function with example usage: test_simple_bar_with_cohorts_dict() and returns: fig