code: def test_checkout_selective_remove(tmp_dir, dvc):
      # Use copy to test for changes in the inodes
      dvc.cache.local.cache_types = ["copy"]
      tmp_dir.dvc_gen({"data": {"foo": "foo", "bar": "bar"}})
  
      foo_inode = system.inode(os.path.join("data", "foo"))
      bar_inode = system.inode(os.path.join("data", "bar"))
      # move instead of remove, to lock inode assigned to stage_files[0].path
      # if we were to use remove, we might end up with same inode assigned to
      # newly checked out file
      shutil.move(os.path.join("data", "foo"), "random_name")
  
      assert main(["checkout", "--force", "data.dvc"]) == 0
      assert (tmp_dir / "data").read_text() == {
          "foo": "foo",
          "bar": "bar",
      }
      assert system.inode(os.path.join("data", "foo")) != foo_inode
      assert system.inode(os.path.join("data", "bar")) == bar_inode
  
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 5 for calling a global function with example usage: test_checkout_selective_remove(tmp_dir, dvc) without return types