code: def _plot_metric(
      feature,
      metric,
      dates,
      values,
      static_bounds,
      fdbounds,
      prefix,
      suffices,
      last_n,
      skip_first_n,
      skip_last_n,
      primary_color,
      zline_color,
  ):
      """Split off plot histogram generation to allow for parallel processing"""
      # pick up static traffic light boundaries
      name = f"{feature}:{metric}"
      sbounds = static_bounds.get(name, ())
      # pick up dynamic traffic light boundaries
      names = [prefix + metric + suffix for suffix in suffices]
      dbounds = tuple(
          _prune(
              fdbounds[n].tolist(), last_n, skip_first_n, skip_last_n
          )
          for n in names
          if n in fdbounds.columns
      )
      # choose dynamic bounds if present
      bounds = dbounds if len(dbounds) > 0 else sbounds
  
      # prune dates and values
      dates = _prune(dates, last_n, skip_first_n, skip_last_n)
      values = _prune(values, last_n, skip_first_n, skip_last_n)
  
      # make plot. note: slow!
      plot = plot_bars(
          data=values,
          labels=dates,
          ylim=True,
          bounds=bounds,
          primary_color=primary_color,
          tl_colors=zline_color,
          metric=metric,
      )
  
      if not isinstance(plot, dict):
          return {
              "name": metric,
              "type": "barplot",
              "description": get_stat_description(metric),
              "plot": plot,
              "layout": plot,
          }
  
      return {
          "name": metric,
          "type": "barplot",
          "description": get_stat_description(metric),
          "plot": plot["data"],
          "shapes": plot["layout"]["shapes"]
          if "shapes" in plot["layout"]
          else "",
          "yaxis_range": (
              [
                  "null" if r is None else r
                  for r in plot["layout"]["yaxis"]["range"]
              ]
              if "range" in plot["layout"]["yaxis"]
              else ""
          ),
          "layout": plot["layout"],
      }
  
file_path: popmon/popmon/visualization/section_generator.py
imports: from __future__ import annotations
  from collections import defaultdict
  import numpy
  import pandas
  from tqdm import tqdm
  from popmon.analysis.comparison import Comparisons
  from popmon.analysis.profiling import Profiles
  from popmon.base import Module
  from popmon.config import Report
  from popmon.utils import filter_metrics, parallel, short_date
  from popmon.visualization.utils import _prune, plot_bars
label_desc: Use image node_id 2 for calling a global function with example usage: _plot_metric(feature, metric, dates, values, static_bounds, fdbounds, prefix, suffices, last_n, skip_first_n, skip_last_n, primary_color, zline_color) and returns: dict, dict