code: def plot_bar(data_dict, title="", xtitle="", ytitle=""):
      if data_dict.get("scores", None) is None:  # pragma: no cover
          return None
      x = data_dict["names"].copy()
      y = data_dict["scores"].copy()
      y_upper_err = data_dict.get("upper_bounds", None)
      if y_upper_err is not None:
          y_err = y_upper_err - y
      else:
          y_err = None
      multiclass = isinstance(y, np.ndarray) and y.ndim == 2
      traces = []
      if multiclass:
          for i in range(y.shape[1]):
              class_name = (
                  "Class {}".format(i)
                  if "meta" not in data_dict
                  else data_dict["meta"]["label_names"][i]
              )
              class_bar = go.Bar(
                  x=x,
                  y=y[:, i],
                  error_y=dict(
                      type="data", array=y_err[:, i], visible=True
                  ),
                  name=class_name,
              )
              traces.append(class_bar)
      else:
          trace = go.Bar(
              x=x,
              y=y,
              error_y=dict(
                  type="data",
                  color="#ff6614",
                  array=y_err,
                  visible=True,
              ),
          )
          traces.append(trace)
      layout = go.Layout(
          title=title,
          showlegend=False,
          xaxis=dict(title=xtitle, type="category"),
          yaxis=dict(title=ytitle),
      )
      yrange = None
      if data_dict.get("scores_range", None) is not None:
          scores_range = data_dict["scores_range"]
          yrange = scores_range
      main_fig = go.Figure(data=traces, layout=layout)
  
      if multiclass:
          main_fig.update_layout(barmode="group")
  
      # Add density
      if data_dict.get("density", None) is not None:
          figure = _plot_with_density(
              data_dict["density"],
              main_fig,
              title=title,
              is_categorical=True,
              yrange=yrange,
              showlegend=multiclass,
          )
      else:
          figure = main_fig
      return figure
  
imports: import plotly.graph_objs
  import numpy
  from plotly import subplots
  import matplotlib.pyplot
  from numbers import Number
  import logging
label_desc: Use image node_id 11 for calling a global function with example usage: plot_bar(data_dict, title, xtitle, ytitle) and returns: figure, None