code: def test_remove_experiments_by_rev(tmp_dir, scm, dvc, exp_stage):
      baseline = scm.get_rev()
  
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=1"]
      )
      baseline_exp_ref = first(exp_refs_by_rev(scm, first(results)))
  
      dvc.experiments.run(
          exp_stage.addressing,
          params=["foo=2"],
          queue=True,
          name="queue2",
      )
      scm.commit("new_baseline")
  
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=3"]
      )
      ref_info = first(exp_refs_by_rev(scm, first(results)))
      new_exp_ref = str(ref_info)
  
      dvc.experiments.run(
          exp_stage.addressing,
          params=["foo=4"],
          queue=True,
          name="queue4",
      )
  
      assert dvc.experiments.remove(rev=baseline) == [
          baseline_exp_ref.name
      ]
      queue_revs = {
          entry.name: entry.stash_rev
          for entry in dvc.experiments.celery_queue.iter_queued()
      }
      assert scm.get_ref(str(baseline_exp_ref)) is None
      assert "queue2" in queue_revs
      assert scm.get_ref(new_exp_ref) is not None
      assert "queue4" in queue_revs
  
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 6 for calling a global function with example usage: test_remove_experiments_by_rev(tmp_dir, scm, dvc, exp_stage) without return types