code: def _rename_exp(scm: "Git", ref_info: "ExpRefInfo", new_name: str):
      rev = scm.get_ref(str(ref_info))
      scm.remove_ref(str(ref_info))
      ref_info.name = new_name
      scm.set_ref(str(ref_info), rev)
      return new_name
  
file_path: dvc/dvc/repo/experiments/rename.py
imports: from typing import TYPE_CHECKING, Dict, List, Optional, Union
  from dvc.log import logger
  from dvc.repo.experiments.exceptions import ExperimentExistsError, UnresolvedExpNamesError
  from dvc.repo.experiments.utils import check_ref_format, resolve_name
  from dvc.scm import Git
  from .refs import ExpRefInfo
label_desc: Use image node_id 2 for calling a global function with example usage: _rename_exp(scm, ref_info, new_name) and returns: new_name