import fnmatch


def _filternames(open_zipfile, ignore_patterns):
    """Generate a list of files to extract from a zipfile which do not match a pattern"""
    if ignore_patterns:
        namelist = set(open_zipfile.namelist())
        for pattern in ignore_patterns:
            namelist -= set(fnmatch.filter(namelist, pattern))
        return list(namelist)