<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def unzip(archive, destination, filenames=None):
 """Unzip a zip archive into destination directory. It unzips either the whole archive or specific file(s) from the archive. Usage: Args: archive (zipfile.ZipFile or str):
 Zipfile object to extract from or path to the zip archive. destination (str):
 Path to the output directory. filenames (str or list of str or None):
 Path(s) to the filename(s) inside the zip archive that you want to extract. """

    close = False
    try:
        if not isinstance(archive, zipfile.ZipFile):
            archive = zipfile.ZipFile(archive, "r", allowZip64=True)
            close = True
        logger.info("Extracting: %s -> %s" % (archive.filename, destination))
        if isinstance(filenames, str):
            filenames = [filenames]
        if filenames is None:  # extract all
            filenames = archive.namelist()
        for filename in filenames:
            if filename.endswith("/"):  # it's a directory
                shell.mkdir(os.path.join(destination, filename))
            else:
                if not _extract_file(archive, destination, filename):
                    raise Exception()
        logger.info('Extracting zip archive "%s" succeeded' % archive.filename)
        return True
    except Exception:
        logger.exception("Error while unzipping archive %s" % archive.filename)
        return False
    finally:
        if close:
            archive.close()