code: def test_commit_with_deps(tmp_dir, dvc, run_copy):
      tmp_dir.gen("foo", "foo")
      (foo_stage,) = dvc.add("foo", no_commit=True)
      assert foo_stage is not None
      assert len(foo_stage.outs) == 1
  
      stage = run_copy("foo", "file", no_commit=True, name="copy")
      assert stage is not None
      assert len(stage.outs) == 1
  
      assert foo_stage.outs[0].changed_cache()
      assert stage.outs[0].changed_cache()
  
      dvc.commit(stage.path, with_deps=True)
      assert not foo_stage.outs[0].changed_cache()
      assert not stage.outs[0].changed_cache()
  
imports: import os
  import textwrap
  import pytest
  from dvc.dependency.base import DependencyDoesNotExistError
  from dvc.dvcfile import PROJECT_FILE
  from dvc.fs import localfs
  from dvc.output import OutputDoesNotExistError
  from dvc.stage.exceptions import StageCommitError
label_desc: Use image node_id 4 for calling a global function with example usage: test_commit_with_deps(tmp_dir, dvc, run_copy) without return types