code: def test_remove_stage_preserves_comment(tmp_dir, dvc, run_copy):
      tmp_dir.gen(
          "dvc.yaml",
          textwrap.dedent(
              """\
              stages:
                  generate-foo:
                      cmd: "echo foo > foo"
                      # This copies 'foo' text to 'foo' file.
                      outs:
                      - foo
                  copy-foo-bar:
                      cmd: "python copy.py foo bar"
                      deps:
                      - foo
                      outs:
                      - bar"""
          ),
      )
  
      dvc.reproduce(PROJECT_FILE)
  
      dvc_file = load_file(dvc, PROJECT_FILE)
  
      assert dvc_file.exists()
      assert (tmp_dir / LOCK_FILE).exists()
      assert (tmp_dir / "foo").exists()
      assert (tmp_dir / "bar").exists()
  
      dvc_file.remove_stage(dvc_file.stages["copy-foo-bar"])
      assert (
          "# This copies 'foo' text to 'foo' file."
          in (tmp_dir / PROJECT_FILE).read_text()
      )
  
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 14 for calling a global function with example usage: test_remove_stage_preserves_comment(tmp_dir, dvc, run_copy) without return types