code: def test_checkout_partial_unchanged(tmp_dir, dvc):
      original_dir_shape = {
          "foo": "foo",
          "bar": "bar",
          "sub_dir": {"baz": "baz"},
          "empty_sub_dir": {},
      }
      tmp_dir.dvc_gen({"data": original_dir_shape})
  
      data_dir = tmp_dir / "data"
      sub_dir = data_dir / "sub_dir"
      foo = data_dir / "foo"
      bar = data_dir / "bar"
      sub_dir_file = sub_dir / "baz"
  
      # Nothing changed, nothing added/deleted/modified
      stats = dvc.checkout(str(bar))
      assert not any(stats.values())
  
      # Irrelevant file changed, still nothing added/deleted/modified
      foo.unlink()
      stats = dvc.checkout(str(bar))
      assert not any(stats.values())
  
      # Relevant change, one modified
      bar.unlink()
      stats = dvc.checkout(str(bar))
      assert len(stats["modified"]) == 1
  
      # No changes inside data/sub
      stats = dvc.checkout(str(sub_dir))
      assert not any(stats.values())
  
      # Relevant change, one modified
      sub_dir_file.unlink()
      stats = dvc.checkout(str(sub_dir))
      assert len(stats["modified"]) == 1
  
      stats = dvc.checkout(str(data_dir / "empty_sub_dir"))
      assert stats == {**empty_checkout, "modified": ["data" + os.sep]}
  
      dvc.checkout(str(data_dir))
  
      # Everything is in place, no action taken
      stats = dvc.checkout(str(data_dir))
      assert not any(stats.values())
  
imports: import logging
  import os
  import shutil
  import stat
  import textwrap
  import pytest
  from dvc.cli import main
  from dvc.dvcfile import PROJECT_FILE, load_file
  from dvc.exceptions import CheckoutError, CheckoutErrorSuggestGit, NoOutputOrStageError
  from dvc.fs import system
  from dvc.stage.exceptions import StageFileDoesNotExistError
  from dvc.utils import relpath
  from dvc.utils.fs import remove
  from tests.utils import get_gitignore_content
label_desc: Use image node_id 36 for calling a global function with example usage: test_checkout_partial_unchanged(tmp_dir, dvc) without return types