code: def copytree(
      src: str,
      dst: str,
      selector: Optional[Callable[[str], bool]] = None,
      src_root: Optional[str] = None,
  ) -> str:
      if src_root is None:
          src_root = src
      with os.scandir(src) as itr:
          entries = list(itr)
      return _copytree(
          entries=entries,
          src=src,
          dst=dst,
          selector=selector,
          src_root=src_root,
      )
  
imports: import contextlib
  import glob
  import logging
  import os
  import pathlib
  import shutil
  from typing import Any, Callable, Dict, Iterator, List, Optional, Union
  from determined import errors, util
  from determined.common import check, storage
label_desc: Use image node_id 2 for calling a global function with example usage: copytree(src, dst, selector, src_root) and returns: _copytree