code: def test_exp_save_with_staged_changes(tmp_dir, dvc, scm):
      setup_stage(tmp_dir, dvc, scm)
      tmp_dir.gen({"deleted": "deleted", "modified": "modified"})
      scm.add_commit(["deleted", "modified"], "init")
  
      (tmp_dir / "deleted").unlink()
      tmp_dir.gen({"new_file": "new_file"})
      (tmp_dir / "modified").write_text("foo")
      scm.add(["deleted", "new_file", "modified"])
  
      exp_rev = dvc.experiments.save(name="exp")
      scm.checkout(exp_rev, force=True)
      assert not (tmp_dir / "deleted").exists()
      assert (tmp_dir / "new_file").exists()
      assert (tmp_dir / "modified").read_text() == "foo"
  
file_path: dvc/tests/func/experiments/test_save.py
imports: import pytest
  from funcy import first
  from dvc.repo.experiments.exceptions import ExperimentExistsError, InvalidArgumentError
  from dvc.repo.experiments.utils import exp_refs_by_rev
  from dvc.scm import resolve_rev
label_desc: Use image node_id 7 for calling a global function with example usage: test_exp_save_with_staged_changes(tmp_dir, dvc, scm) without return types