code: def test_partial_checkout(tmp_dir, dvc, target):
      tmp_dir.dvc_gen(
          {"dir": {"subdir": {"file": "file"}, "other": "other"}}
      )
      shutil.rmtree("dir")
      stats = dvc.checkout([target])
      assert stats["added"] == ["dir" + os.sep]
      assert list(walk_files("dir")) == [
          os.path.join("dir", "subdir", "file")
      ]
  
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 19 for calling a global function with example usage: test_partial_checkout(tmp_dir, dvc, target) without return types