code: def _plot_metrics(
      values,
  ):
      # sort features by n_red, n_yellow, n_green
      values = dict(
          sorted(
              values.items(),
              key=lambda x: (
                  x[1][2] / x[1]["total"] if x[1]["total"] > 0 else 0,
                  x[1][1] / x[1]["total"] if x[1]["total"] > 0 else 0,
                  x[1][0] / x[1]["total"] if x[1]["total"] > 0 else 0,
              ),
              reverse=True,
          )
      )
  
      plot = templates_env(
          "aggregated-overview.html",
          values=values,
      )
  
      return {
          "name": "Alerts",
          "type": "alert",
          "description": "",
          "plot": plot,
          "layout": "",
          "full_width": True,
      }
  
file_path: popmon/popmon/visualization/overview_section.py
imports: from __future__ import annotations
  from datetime import datetime
  import numpy
  import pandas
  from tqdm import tqdm
  from popmon.base import Module
  from popmon.config import Report
  from popmon.resources import templates_env
  from popmon.utils import filter_metrics
  from popmon.version import version
  from popmon.visualization.utils import _prune, get_reproduction_table, get_summary_table
label_desc: Use image node_id 1 for calling a global function with example usage: _plot_metrics(values) and returns: dict