code: def bar(
      data: dict,
      title: str = "Bar",
      x_legend: str = "",
      y_legend: str = "",
  ):
      import plotly.graph_objects as go
  
      if not data:
          return empty_visualization()
  
      keys, values = zip(*data.items())
      keys = [
          key.encode("unicode-escape").decode()
          if isinstance(key, str)
          else key
          for key in keys
      ]
      fig = go.Figure(data=go.Bar(y=values, x=keys))
      fig.update_layout(
          title=title,
          xaxis_title=x_legend,
          yaxis_title=y_legend,
      )
      return fig
  
file_path: argilla/src/argilla/metrics/helpers.py
imports: from typing import Dict
label_desc: Use image node_id 2 for calling a global function with example usage: bar(data, title, x_legend, y_legend) and returns: fig, empty_visualization