code: def _copytree(
      entries,
      src,
      dst,
      symlinks,
      ignore,
      copy_function,
      ignore_dangling_symlinks,
      dirs_exist_ok=False,
  ):
      if ignore is not None:
          ignored_names = ignore(
              os.fspath(src), [x.name for x in entries]
          )
      else:
          ignored_names = ()
  
      os.makedirs(dst, exist_ok=dirs_exist_ok)
      errors = []
      use_srcentry = copy_function is copy2 or copy_function is copy
  
      for srcentry in entries:
          if srcentry.name in ignored_names:
              continue
          srcname = os.path.join(src, srcentry.name)
          dstname = os.path.join(dst, srcentry.name)
          srcobj = srcentry if use_srcentry else srcname
          try:
              is_symlink = srcentry.is_symlink()
              if is_symlink and os.name == "nt":
                  # Special check for directory junctions, which appear as
                  # symlinks but we want to recurse.
                  lstat = srcentry.stat(follow_symlinks=False)
                  if (
                      lstat.st_reparse_tag
                      == stat.IO_REPARSE_TAG_MOUNT_POINT
                  ):
                      is_symlink = False
              if is_symlink:
                  linkto = os.readlink(srcname)
                  if symlinks:
                      # We can't just leave it to `copy_function` because legacy
                      # code with a custom `copy_function` may rely on copytree
                      # doing the right thing.
                      os.symlink(linkto, dstname)
                      copystat(
                          srcobj, dstname, follow_symlinks=not symlinks
                      )
                  else:
                      # ignore dangling symlink if the flag is on
                      if (
                          not os.path.exists(linkto)
                          and ignore_dangling_symlinks
                      ):
                          continue
                      # otherwise let the copy occur. copy2 will raise an error
                      if srcentry.is_dir():
                          copytree(
                              srcobj,
                              dstname,
                              symlinks,
                              ignore,
                              copy_function,
                              ignore_dangling_symlinks,
                              dirs_exist_ok,
                          )
                      else:
                          copy_function(srcobj, dstname)
              elif srcentry.is_dir():
                  copytree(
                      srcobj,
                      dstname,
                      symlinks,
                      ignore,
                      copy_function,
                      ignore_dangling_symlinks,
                      dirs_exist_ok,
                  )
              else:
                  # Will raise a SpecialFileError for unsupported file types
                  copy_function(srcobj, dstname)
          # catch the Error from the recursive copytree so that we can
          # continue with other files
          except Error as err:
              errors.extend(err.args[0])
          except OSError as why:
              errors.append((srcname, dstname, str(why)))
      try:
          copystat(src, dst)
      except OSError as why:
          # Copying file access times may fail on Windows
          if getattr(why, "winerror", None) is None:
              errors.append((src, dst, str(why)))
      if errors:
          raise Error(errors)
      return dst
  
imports: import os
  import sys
  import stat
  import fnmatch
  import collections
  import errno
label_desc: Use image node_id 14 for calling a global function with example usage: _copytree(entries, src, dst, symlinks, ignore, copy_function, ignore_dangling_symlinks, dirs_exist_ok) and returns: dst