import fnmatch


def filtered(names, blacklist):
    """Filter the list of file or directory names."""
    rv = names[:]
    for pattern in blacklist:
        rv = [n for n in rv if not fnmatch.fnmatch(n, pattern)]
    return rv