code: def _copy_archive(archive, new_archive, interpreter=None):
      """Copy an application archive, modifying the shebang line."""
      with _maybe_open(archive, "rb") as src:
          # Skip the shebang line from the source.
          # Read 2 bytes of the source and check if they are #!.
          first_2 = src.read(2)
          if first_2 == b"#!":
              # Discard the initial 2 bytes and the rest of the shebang line.
              first_2 = b""
              src.readline()
  
          with _maybe_open(new_archive, "wb") as dst:
              _write_file_prefix(dst, interpreter)
              # If there was no shebang, "first_2" contains the first 2 bytes
              # of the source file, so write them before copying the rest
              # of the file.
              dst.write(first_2)
              shutil.copyfileobj(src, dst)
  
      if interpreter and isinstance(new_archive, str):
          os.chmod(
              new_archive, os.stat(new_archive).st_mode | stat.S_IEXEC
          )
  
file_path: catboost/contrib/tools/python3/src/Lib/zipapp.py
imports: import contextlib
  import os
  import pathlib
  import shutil
  import stat
  import sys
  import zipfile
label_desc: Use image node_id 3 for calling a global function with example usage: _copy_archive(archive, new_archive, interpreter) without return types