human
Complete the below
def make_zipfile(zip_filename, base_dir, verbose=0, dry_run=0, compress=None, 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.'
    '''
 ... What is a the Python code you requested?
assistant
#Here is the Python code you requested.
    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))
    if (compress is None):
        compress = (sys.version >= '2.4')
    compression = [zipfile.ZIP_STORED, zipfile.ZIP_DEFLATED][bool(compress)]
    if (not dry_run):
        z = zipfile.ZipFile(zip_filename, mode, compression=compression)
        os.path.walk(base_dir, visit, z)
        z.close()
    else:
        os.path.walk(base_dir, visit, None)
    return zip_filename