code: def bar_groups(
      records,
      ax=None,
      group_by=None,
      get_value=lambda data: data,
      get_error=None,
  ):
      dg = DataGrid(records, group_by=group_by)
      bs = BarShifter(*dg.shape, ax=ax)
  
      for name, data in dg.rowiter():
          if get_error is not None:
              yerr = [get_error(d) for d in data]
          else:
              yerr = None
  
          bs(
              [get_value(d) for d in data],
              yerr=yerr,
              label=f"{dg.params[0]}={name}",
          )
  
      ax.set_xticklabels(dg.colnames())
      ax.set_xlabel(dg.params[1])
  
      plt.legend()
  
      return ax
  
file_path: sklearn-evaluation/src/sklearn_evaluation/plot/matplotlib/bar.py
imports: import numpy
  import matplotlib.pyplot
  from sklearn_evaluation.plot.matplotlib.data_grid import DataGrid
  from sklearn_evaluation.plot.util import set_default_ax
label_desc: Use image node_id 4 for calling a global function with example usage: bar_groups(records, ax, group_by, get_value, get_error) and returns: ax