code: def test_remove_experiments_by_ref(
      tmp_dir, scm, dvc, exp_stage, caplog
  ):
      queue_length = 3
      ref_info_list = []
      ref_name_list = []
  
      for i in range(queue_length):
          results = dvc.experiments.run(
              exp_stage.addressing, params=[f"foo={i}"]
          )
          ref_info = first(exp_refs_by_rev(scm, first(results)))
          ref_info_list.append(ref_info)
          ref_name_list.append(str(ref_info))
  
      with pytest.raises(InvalidArgumentError):
          dvc.experiments.remove(ref_name_list[:2] + ["non-exist"])
      assert scm.get_ref(ref_name_list[0]) is not None
      assert scm.get_ref(ref_name_list[1]) is not None
      assert scm.get_ref(ref_name_list[2]) is not None
  
      assert set(dvc.experiments.remove(ref_name_list[:2])) == set(
          ref_name_list[:2]
      )
      assert scm.get_ref(ref_name_list[0]) is None
      assert scm.get_ref(ref_name_list[1]) is None
      assert scm.get_ref(ref_name_list[2]) is not None
  
file_path: dvc/tests/func/experiments/test_remove.py
imports: import pytest
  from funcy import first
  from dvc.exceptions import InvalidArgumentError
  from dvc.repo.experiments.exceptions import UnresolvedExpNamesError
  from dvc.repo.experiments.utils import exp_refs_by_rev
label_desc: Use image node_id 1 for calling a global function with example usage: test_remove_experiments_by_ref(tmp_dir, scm, dvc, exp_stage, caplog) without return types