code: def get_all_stats_by_name(
      stats: Iterable[Stat], name: str
  ) -> List[Stat]:
      """Returns a list of all stats with the specified name."""
  
      def matches(stat):
          return stat.name.name == name
  
      return list(filter(matches, stats))
  
imports: from abc import ABC
  from dataclasses import dataclass, replace
  from collections import defaultdict
  from typing import List, Dict, Tuple, Optional, Iterable, Set
  from helm.common.object_spec import ObjectSpec, create_object
  from helm.common.general import singleton, parallel_map
  from helm.benchmark.augmentations.perturbation_description import PerturbationDescription, PERTURBATION_ORIGINAL, PERTURBATION_WORST
  from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_LANGUAGE_MODELING
  from helm.benchmark.adaptation.scenario_state import ScenarioState
  from helm.benchmark.adaptation.request_state import RequestState
  from helm.benchmark.adaptation.adapter_spec import AdapterSpec
  from helm.benchmark.scenarios.scenario import Instance
  from .metric_name import MetricName, MetricContext
  from .metric_service import MetricService
  from .statistic import Stat, merge_stat
label_desc: Use image node_id 2 for calling a global function with example usage: get_all_stats_by_name(stats, name) and returns: list, unknown