code: def _get_metric_names_for_group(
      run_group_name: str, schema: Schema
  ) -> Set[str]:
      metric_groups_by_name = {
          metric_group.name: metric_group
          for metric_group in schema.metric_groups
      }
      run_groups_by_name = {
          run_group.name: run_group for run_group in schema.run_groups
      }
  
      result: Set[str] = set()
      run_group = run_groups_by_name.get(run_group_name)
      if run_group is None:
          return result
  
      for metric_group_name in run_group.metric_groups:
          metric_group = metric_groups_by_name.get(metric_group_name)
          if metric_group is None:
              continue
          for metric_name_matcher in metric_group.metrics:
              if metric_name_matcher.perturbation_name:
                  continue
              result.add(
                  metric_name_matcher.substitute(
                      run_group.environment
                  ).name
              )
      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 4 for calling a global function with example usage: _get_metric_names_for_group(run_group_name, schema) and returns: result, result