code: def test_apply_queued(tmp_dir, scm, dvc, exp_stage):
      metrics_original = (tmp_dir / "metrics.yaml").read_text().strip()
      dvc.experiments.run(
          exp_stage.addressing,
          params=["foo=2"],
          name="exp-a",
          queue=True,
      )
      dvc.experiments.run(
          exp_stage.addressing,
          params=["foo=3"],
          name="exp-b",
          queue=True,
      )
      queue_revs = {
          entry.name: entry.stash_rev
          for entry in dvc.experiments.celery_queue.iter_queued()
      }
  
      dvc.experiments.apply(queue_revs["exp-a"])
      assert (tmp_dir / "params.yaml").read_text().strip() == "foo: 2"
      assert (
          tmp_dir / "metrics.yaml"
      ).read_text().strip() == metrics_original
  
      dvc.experiments.apply(queue_revs["exp-b"])
      assert (tmp_dir / "params.yaml").read_text().strip() == "foo: 3"
      assert (
          tmp_dir / "metrics.yaml"
      ).read_text().strip() == metrics_original
  
file_path: dvc/tests/func/experiments/test_apply.py
imports: import pytest
  from funcy import first
  from dvc.repo.experiments.refs import CELERY_STASH
label_desc: Use image node_id 3 for calling a global function with example usage: test_apply_queued(tmp_dir, scm, dvc, exp_stage) without return types