code: def test_checkouts_with_different_addressing(tmp_dir, dvc, run_copy):
      tmp_dir.gen({"foo": "foo", "lorem": "lorem"})
      run_copy("foo", "bar", name="copy-foo-bar")
      run_copy("lorem", "ipsum", name="copy-lorem-ipsum")
  
      (tmp_dir / "bar").unlink()
      (tmp_dir / "ipsum").unlink()
      assert set(dvc.checkout(PROJECT_FILE)["added"]) == {
          "bar",
          "ipsum",
      }
  
      (tmp_dir / "bar").unlink()
      (tmp_dir / "ipsum").unlink()
      assert set(dvc.checkout(":")["added"]) == {"bar", "ipsum"}
  
      (tmp_dir / "bar").unlink()
      assert dvc.checkout("copy-foo-bar")["added"] == ["bar"]
  
      (tmp_dir / "bar").unlink()
      assert dvc.checkout("dvc.yaml:copy-foo-bar")["added"] == ["bar"]
  
      (tmp_dir / "bar").unlink()
      assert dvc.checkout(":copy-foo-bar")["added"] == ["bar"]
  
      (tmp_dir / "bar").unlink()
      (tmp_dir / "data").mkdir()
      with (tmp_dir / "data").chdir():
          assert dvc.checkout(
              relpath(tmp_dir / "dvc.yaml") + ":copy-foo-bar"
          )["added"] == [relpath(tmp_dir / "bar")]
  
      (tmp_dir / "bar").unlink()
      assert dvc.checkout("bar")["added"] == ["bar"]
  
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 31 for calling a global function with example usage: test_checkouts_with_different_addressing(tmp_dir, dvc, run_copy) without return types