code: def exp_refs_by_names(
      scm: "Git", names: Set[str], url: Optional[str] = None
  ) -> Dict[str, List[ExpRefInfo]]:
      """Iterate over all experiment refs matching the specified names."""
      resolve_results = defaultdict(list)
      ref_info_gen = exp_refs(scm, url)
      for ref_info in ref_info_gen:
          if ref_info.name in names:
              resolve_results[ref_info.name].append(ref_info)
  
      return resolve_results
  
imports: import os
  import random
  import sys
  from collections import defaultdict
  from functools import wraps
  from typing import TYPE_CHECKING, Callable, Dict, Generator, Iterable, List, Mapping, Optional, Set, Tuple, Union
  from dvc.exceptions import InvalidArgumentError
  from dvc.repo.experiments.exceptions import AmbiguousExpRefInfo
  from dvc.rwlock import rwlock
  from dvc.scm import Git
  from .refs import EXEC_APPLY, EXEC_BASELINE, EXEC_BRANCH, EXPS_NAMESPACE, ITER_SKIP_NAMESPACES, STASHES, ExpRefInfo
label_desc: Use image node_id 10 for calling a global function with example usage: exp_refs_by_names(scm, names, url) and returns: resolve_results