code: def _get_metric_names_for_groups(
      run_group_names: Iterable[str], schema: Schema
  ) -> Set[str]:
      result: Set[str] = set()
      for run_group_name in run_group_names:
          result.update(
              _get_metric_names_for_group(run_group_name, schema)
          )
      return result
  
imports: from collections import OrderedDict, defaultdict
  from dataclasses import dataclass
  import os
  from typing import Dict, Iterable, List, Optional, Set, Tuple
  from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_MULTIPLE_CHOICE_SEPARATE_METHODS, ADAPT_MULTIPLE_CHOICE_SEPARATE_CALIBRATED
  from helm.benchmark.adaptation.adapter_spec import AdapterSpec
  from helm.benchmark.adaptation.request_state import RequestState
  from helm.benchmark.adaptation.scenario_state import ScenarioState
  from helm.benchmark.augmentations.perturbation_description import PerturbationDescription
  from helm.benchmark.metrics.metric import PerInstanceStats
  from helm.benchmark.presentation.schema import Schema
  from helm.benchmark.runner import RunSpec
  from helm.benchmark.scenarios.scenario import Instance
  from helm.common.general import write
  from helm.common.hierarchical_logger import htrack
  from helm.common.request import Request
  from helm.common.codec import from_json, to_json
label_desc: Use image node_id 5 for calling a global function with example usage: _get_metric_names_for_groups(run_group_names, schema) and returns: result