code: def test_modified(tmp_dir, scm, dvc, caplog, tmp, staged):
      tmp_dir.scm_gen("file", "file", commit="commit file")
      stage = dvc.stage.add(
          cmd="cat file",
          name="foo",
      )
      scm.add_commit(["dvc.yaml"], message="add dvc.yaml")
  
      (tmp_dir / "file").write_text("modified_file")
      if staged:
          scm.add(["file"])
  
      results = dvc.experiments.run(stage.addressing, tmp_dir=tmp)
  
      exp = first(results)
      scm.checkout(exp, force=True)
      assert (tmp_dir / "file").read_text() == "modified_file"
  
imports: import pytest
  from funcy import first
  from dvc.dependency.base import DependencyDoesNotExistError
  from dvc.exceptions import ReproductionError
label_desc: Use image node_id 2 for calling a global function with example usage: test_modified(tmp_dir, scm, dvc, caplog, tmp, staged) without return types