code: def test_copytree(
      tmp_path: Path, manager: storage.SharedFSStorageManager
  ) -> None:
      src_dir = tmp_path.joinpath("src")
      util.create_checkpoint(src_dir, util.EXPECTED_FILES)
  
      dst_dir = tmp_path.joinpath("dst0")
      shared.copytree(str(src_dir), str(dst_dir), selector=None)
      util.validate_checkpoint(
          dst_dir, expected_files=util.EXPECTED_FILES
      )
  
      dst_dir = tmp_path.joinpath("dst1")
  
      def selector1(x: str) -> bool:
          return False
  
      shared.copytree(str(src_dir), str(dst_dir), selector=selector1)
      assert not dst_dir.exists()
  
      dst_dir = tmp_path.joinpath("dst2")
  
      def selector2(x: str) -> bool:
          return True
  
      shared.copytree(str(src_dir), str(dst_dir), selector=selector2)
      util.validate_checkpoint(
          dst_dir, expected_files=util.EXPECTED_FILES
      )
  
      dst_dir = tmp_path.joinpath("dst3")
  
      def selector3(x: str) -> bool:
          return x == "empty_dir/"
  
      shared.copytree(str(src_dir), str(dst_dir), selector=selector3)
      util.validate_checkpoint(
          dst_dir, expected_files={"empty_dir/": None}
      )
  
      dst_dir = tmp_path.joinpath("dst4")
  
      def selector4(x: str) -> bool:
          return x in ["root.txt", "subdir/"]
  
      shared.copytree(str(src_dir), str(dst_dir), selector=selector4)
      util.validate_checkpoint(
          dst_dir,
          expected_files={"root.txt": "root file", "subdir/": None},
      )
  
      dst_dir = tmp_path.joinpath("dst5")
  
      def selector5(x: str) -> bool:
          return x == "subdir/file2.txt"
  
      shared.copytree(str(src_dir), str(dst_dir), selector=selector5)
      util.validate_checkpoint(
          dst_dir,
          expected_files={
              "subdir/file2.txt": "nested file 2",
              "subdir/": None,
          },
      )
  
      # Test copytree with symlinks.
      src_dir1 = tmp_path.joinpath("src1")
      util.create_checkpoint(src_dir1, {"file_1": "content 1"})
  
      src_dir2 = tmp_path.joinpath("src2")
      util.create_checkpoint(
          src_dir2,
          {
              "symlink_dir/": None,
              "symlink_dir/file_nested": "nested file",
              "file_2": "content 2",
          },
      )
  
      os.symlink(
          src_dir2.joinpath("symlink_dir"),
          src_dir1.joinpath("subdir"),
          target_is_directory=True,
      )
  
      dst_dir = tmp_path.joinpath("dst6")
      shared.copytree(str(src_dir1), str(dst_dir))
  
      util.validate_checkpoint(
          dst_dir,
          expected_files={
              "file_1": "content 1",
              "subdir/": None,
              "subdir/file_nested": "nested file",
          },
      )
  
imports: import os
  import shutil
  import unittest.mock
  import uuid
  from pathlib import Path
  from typing import Any, Dict, List
  import pytest
  from determined.common import check, storage
  from determined.common.storage import shared
  from determined.tensorboard.fetchers.shared import SharedFSFetcher
  from tests import parallel
  from tests.storage import util
label_desc: Use image node_id 10 for calling a global function with example usage: test_copytree(tmp_path, manager) and returns: False, True, unknown, unknown, unknown