code: def main():
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "archive",
          metavar="ARCHIVE",
          help="name for the output `.tar.gz` archive",
      )
      parser.add_argument(
          "files",
          metavar="files",
          nargs="*",
          help="files to include in the archive; basenames must be distinct",
      )
      args = parser.parse_args()
      archive = args.archive
      files = args.files
      del args
  
      if len(frozenset(os.path.basename(f) for f in files)) != len(
          files
      ):
          sys.stderr.write(
              "Input basenames must be distinct; got: %r\n" % files
          )
          sys.exit(1)
  
      # (`fd` will be closed by `fdopen` context manager below)
      fd = os.open(archive, os.O_WRONLY | os.O_CREAT, 0o644)
      with os.fdopen(fd, "wb") as out_file, gzip.GzipFile(
          "wb", fileobj=out_file, mtime=0
      ) as gzip_file, tarfile.open(
          fileobj=gzip_file, mode="w:"
      ) as tar_file:
          for f in files:
              arcname = os.path.basename(f)
              tar_file.add(
                  f, filter=cleanse, recursive=False, arcname=arcname
              )
  
imports: import argparse
  import gzip
  import os
  import sys
  import tarfile
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types