code: def test_commit_granular_output(tmp_dir, dvc):
      dvc.run(
          name="mystage",
          cmd=[
              "python -c \"open('foo', 'wb').write(b'foo\\n')\"",
              "python -c \"open('bar', 'wb').write(b'bar\\n')\"",
          ],
          outs=["foo", "bar"],
          no_commit=True,
      )
  
      cache = tmp_dir / ".dvc" / "cache" / "files" / "md5"
      assert not list(cache.glob("*/*"))
  
      dvc.commit("foo")
      assert list(cache.glob("*/*")) == [
          cache / "d3" / "b07384d113edec49eaa6238ad5ff00"
      ]
  
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 7 for calling a global function with example usage: test_commit_granular_output(tmp_dir, dvc) without return types