code: def copy_file(target_dir, filename, rootdir):
      # TODO(rkn): This feels very brittle. It may not handle all cases. See
      # https://github.com/apache/arrow/blob/master/python/setup.py for an
      # example.
      # File names can be absolute paths, e.g. from walk_directory().
      source = os.path.relpath(filename, rootdir)
      destination = os.path.join(target_dir, source)
      # Create the target directory if it doesn't already exist.
      os.makedirs(os.path.dirname(destination), exist_ok=True)
      if not os.path.exists(destination):
          if sys.platform == "win32":
              # Does not preserve file mode (needed to avoid read-only bit)
              shutil.copyfile(source, destination, follow_symlinks=True)
          else:
              # Preserves file mode (needed to copy executable bit)
              shutil.copy(source, destination, follow_symlinks=True)
          return 1
      return 0
  
imports: import argparse
  import errno
  import io
  import logging
  import os
  import pathlib
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  import urllib.error
  import urllib.parse
  import urllib.request
  import warnings
  from enum import Enum
  from itertools import chain
label_desc: Use image node_id 10 for calling a global function with example usage: copy_file(target_dir, filename, rootdir) and returns: int, int