code: def test_remove_stage_removes_dvcfiles_if_no_stages_left(
      tmp_dir, dvc, run_copy
  ):
      tmp_dir.gen("foo", "foo")
      run_copy("foo", "bar", name="run_copy")
  
      dvc_file = load_file(dvc, PROJECT_FILE)
  
      assert dvc_file.exists()
      assert (tmp_dir / LOCK_FILE).exists()
      assert (tmp_dir / "foo").exists()
  
      dvc_file.remove_stage(dvc_file.stages["run_copy"])
      assert not dvc_file.exists()
      assert not (tmp_dir / LOCK_FILE).exists()
  
imports: import textwrap
  import pytest
  from dvc.annotations import Annotation
  from dvc.dvcfile import LOCK_FILE, PROJECT_FILE, ParametrizedDumpError, SingleStageFile, load_file
  from dvc.stage.exceptions import StageFileDoesNotExistError
  from dvc.stage.loader import StageNotFound
  from dvc.utils.strictyaml import YAMLValidationError
label_desc: Use image node_id 15 for calling a global function with example usage: test_remove_stage_removes_dvcfiles_if_no_stages_left(tmp_dir, dvc, run_copy) without return types