code: def test_resolve_exp_ref(
      tmp_dir, scm, git_upstream, name_only, use_url
  ):
      ref, _ = commit_exp_ref(tmp_dir, scm)
      name = "foo" if name_only else ref
      result = resolve_name(scm, [name, "notexist"])
      assert isinstance(result[name], ExpRefInfo)
      assert str(result[name]) == ref
      assert result["notexist"] is None
  
      scm.push_refspecs(git_upstream.url, f"{ref}:{ref}")
      remote = git_upstream.url if use_url else git_upstream.remote
      name = "foo" if name_only else ref
      remote_ref_info = resolve_name(scm, [name], remote)[name]
      assert isinstance(remote_ref_info, ExpRefInfo)
      assert str(remote_ref_info) == ref
  
file_path: dvc/tests/unit/repo/experiments/test_utils.py
imports: import re
  import pytest
  from dvc.exceptions import InvalidArgumentError
  from dvc.repo.experiments.refs import EXPS_NAMESPACE, ExpRefInfo
  from dvc.repo.experiments.utils import check_ref_format, gen_random_name, resolve_name, to_studio_params
label_desc: Use image node_id 2 for calling a global function with example usage: test_resolve_exp_ref(tmp_dir, scm, git_upstream, name_only, use_url) without return types