class_docstr: Summarize the benchmark results in JSON files to be displayed in the UI.
docstr: Use the metric name identified by `matcher` to pull out the stats from
  `runs` and return a representation of the average.
  There are four cases:
  1. No matching runs
  2. Matching runs but no matching stats (maybe stat was named incorrectly)
  3. Matching runs, matching stats, but stats have count = 0, so mean is undefined
     (e.g., bias metric ran and computed 0/0)
  4. Matching runs, matching stats, stats with count > 0
  
  In the first three cases, the cell value is None, but the description distinguishes between these cases.
docstr_tok: ["Use","the","metric","name","identified","by","`","matcher","`","to","pull","out","the","stats","from","`","runs","`","and","return","a","representation","of","the","average",".","There","are","four","cases",":","1",".","No","matching","runs","2",".","Matching","runs","but","no","matching","stats","(","maybe","stat","was","named","incorrectly",")","3",".","Matching","runs",",","matching","stats",",","but","stats","have","count","=","0",",","so","mean","is","undefined","(","e.g.",",","bias","metric","ran","and","computed","0\/0",")","4",".","Matching","runs",",","matching","stats",",","stats","with","count",">","0","In","the","first","three","cases",",","the","cell","value","is","None",",","but","the","description","distinguishes","between","these","cases","."]
code: def create_cell(
      self,
      runs: List[Run],
      matcher: MetricNameMatcher,
      contamination_level: Optional[str],
      additional_info: Optional[str],
      hide_value: bool = False,
  ) -> Cell:
      """
      Use the metric name identified by `matcher` to pull out the stats from
      `runs` and return a representation of the average.
      There are four cases:
      1. No matching runs
      2. Matching runs but no matching stats (maybe stat was named incorrectly)
      3. Matching runs, matching stats, but stats have count = 0, so mean is undefined
         (e.g., bias metric ran and computed 0/0)
      4. Matching runs, matching stats, stats with count > 0
  
      In the first three cases, the cell value is None, but the description distinguishes between these cases.
      """
      # No runs at all
      if len(runs) == 0:
          return Cell(value=None, description="No matching runs")
  
      aggregate_stat: Optional[Stat] = None
      aggregated_run_specs: List[
          str
      ] = (
          []
      )  # keep track of which run_specs we aggregate into the cell for debugging
  
      for run in runs:
          stat = get_unique_stat_by_matcher(run.stats, matcher)
          if stat is None:
              # Print out near misses to provide a more informative warning
              near_misses = [
                  stat
                  for stat in run.stats
                  if stat.name.name == matcher.name
              ]
              hlog(
                  f"WARNING: run spec {run.run_spec.name} does not have any stat matched by {matcher}, "
                  f"{len(near_misses)} near misses matching just the name"
              )
              if len(near_misses) > 0:
                  with htrack_block("Near misses"):
                      for stat in near_misses:
                          hlog(stat.name)
              continue
  
          if aggregate_stat is None:
              aggregate_stat = replace(stat)  # Important: copy!
          else:
              assert stat is not None  # Make type-checking happy
              aggregate_stat.merge(stat)
          aggregated_run_specs.append(run.run_spec.name)
  
      if aggregate_stat is None:
          return Cell(
              value=None,
              description=f"{len(runs)} matching runs, but no matching metrics",
          )
  
      # TODO: need to exclude contaminated numbers somehow
      value: Optional[float] = (
          None if hide_value else aggregate_stat.mean
      )
      description = aggregate_stat.bare_str()
      if additional_info:
          description += "\n" + additional_info
      if self.verbose:
          description += "\n-- ".join(
              ["\nRun specs:", *aggregated_run_specs]
          )
  
      style: Dict[str, Any] = {}
      if contamination_level is not None:
          style = CONTAMINATION_STYLES.get(contamination_level, style)
  
      return Cell(
          value=value,
          description=description,
          style=style,
          contamination_level=contamination_level,
      )
  
imports: import argparse
  import os
  import datetime
  import urllib.parse
  import dacite
  import json
  from collections import defaultdict
  from dataclasses import dataclass, replace
  from statistics import mean, median
  from typing import List, Optional, Dict, Any, Tuple, Set
  from tqdm import tqdm
  from helm.common.general import write, ensure_directory_exists, asdict_without_nones, parallel_map, singleton, unique_simplification
  from helm.common.hierarchical_logger import hlog, htrack, htrack_block
  from helm.benchmark.scenarios.scenario import ScenarioSpec
  from helm.benchmark.adaptation.adapter_spec import AdapterSpec
  from helm.benchmark.metrics.metric_name import MetricName
  from helm.benchmark.metrics.metric import get_all_stats_by_name
  from helm.benchmark.metrics.statistic import Stat, merge_stat
  from helm.benchmark.runner import RunSpec, LATEST_SYMLINK
  from .table import Cell, HeaderCell, Table, Hyperlink, table_to_latex
  from .schema import MetricNameMatcher, RunGroup, read_schema, SCHEMA_YAML_FILENAME, BY_GROUP, THIS_GROUP_ONLY, NO_GROUPS
  from .contamination import read_contamination, validate_contamination, CONTAMINATION_SYMBOLS, CONTAMINATION_STYLES, CONTAMINATION_LEVEL_STRONG
  from .run_display import write_run_display_json
label_desc: Use image node_id 13 for calling the Summarizer obj's underlying member method code with example usage: obj.create_cell(runs, matcher, contamination_level, additional_info, hide_value) and returns: Cell, Cell, Cell