code: def test_remove_all(tmp_dir, scm, dvc, exp_stage):
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=1"]
      )
      ref_info1 = first(exp_refs_by_rev(scm, first(results)))
      dvc.experiments.run(
          exp_stage.addressing, params=["foo=2"], queue=True
      )
      scm.add(
          [
              "dvc.yaml",
              "dvc.lock",
              "copy.py",
              "params.yaml",
              "metrics.yaml",
          ]
      )
      scm.commit("update baseline")
  
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=3"]
      )
      ref_info2 = first(exp_refs_by_rev(scm, first(results)))
      dvc.experiments.run(
          exp_stage.addressing, params=["foo=4"], queue=True
      )
  
      assert set(dvc.experiments.remove(all_commits=True)) == {
          ref_info1.name,
          ref_info2.name,
      }
      assert len(dvc.experiments.stash_revs) == 2
      assert scm.get_ref(str(ref_info2)) is None
      assert scm.get_ref(str(ref_info1)) is 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 4 for calling a global function with example usage: test_remove_all(tmp_dir, scm, dvc, exp_stage) without return types