code: def make_zipfile(
      zip_filename,
      base_dir,
      verbose=0,
      dry_run=0,
      compress=True,
      mode="w",
  ):
      """Create a zip file from all the files under 'base_dir'.  The output
      zip file will be named 'base_dir' + ".zip".  Uses either the "zipfile"
      Python module (if available) or the InfoZIP "zip" utility (if installed
      and found on the default search path).  If neither tool is available,
      raises DistutilsExecError.  Returns the name of the output zip file.
      """
      import zipfile
  
      mkpath(os.path.dirname(zip_filename), dry_run=dry_run)
      log.info(
          "creating '%s' and adding '%s' to it", zip_filename, base_dir
      )
  
      def visit(z, dirname, names):
          for name in names:
              path = os.path.normpath(os.path.join(dirname, name))
              if os.path.isfile(path):
                  p = path[len(base_dir) + 1 :]
                  if not dry_run:
                      z.write(path, p)
                  log.debug("adding '%s'", p)
  
      compression = (
          zipfile.ZIP_DEFLATED if compress else zipfile.ZIP_STORED
      )
      if not dry_run:
          z = zipfile.ZipFile(
              zip_filename, mode, compression=compression
          )
          for dirname, dirs, files in sorted_walk(base_dir):
              visit(z, dirname, files)
          z.close()
      else:
          for dirname, dirs, files in sorted_walk(base_dir):
              visit(None, dirname, files)
      return zip_filename
  
imports: from distutils.dir_util import remove_tree, mkpath
  from distutils import log
  from types import CodeType
  import sys
  import os
  import re
  import textwrap
  import marshal
  from setuptools.extension import Library
  from setuptools import Command
  from .._path import ensure_directory
  from sysconfig import get_path, get_python_version
label_desc: Use image node_id 11 for calling a global function with example usage: make_zipfile(zip_filename, base_dir, verbose, dry_run, compress, mode) and returns: zip_filename