code: def _resolve_exp_by_baseline(
      repo: "Repo",
      rev: List[str],
      num: int,
      git_remote: Optional[str] = None,
  ) -> Dict[str, "ExpRefInfo"]:
      assert isinstance(repo.scm, Git)
  
      commit_ref_dict: Dict[str, "ExpRefInfo"] = {}
      rev_dict = iter_revs(repo.scm, rev, num)
      rev_set = set(rev_dict.keys())
      ref_info_dict = exp_refs_by_baseline(
          repo.scm, rev_set, git_remote
      )
      for _, ref_info_list in ref_info_dict.items():
          for ref_info in ref_info_list:
              commit_ref_dict[ref_info.name] = ref_info
      return commit_ref_dict
  
file_path: dvc/dvc/repo/experiments/remove.py
imports: from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Union
  from dvc.log import logger
  from dvc.repo import locked
  from dvc.repo.scm_context import scm_context
  from dvc.scm import Git, iter_revs
  from .exceptions import UnresolvedExpNamesError
  from .utils import exp_refs, exp_refs_by_baseline, push_refspec
label_desc: Use image node_id 2 for calling a global function with example usage: _resolve_exp_by_baseline(repo, rev, num, git_remote) and returns: commit_ref_dict