def is_file_excluded(filename, excludes):
    """Check if the file should be excluded.

    :param filename: file name
    :param excludes: list of regex to match
    :return: True if the file should be excluded
    """
    # check if you need to exclude this file
    return any([exclude and re.match(exclude, filename) is not None
                for exclude in excludes])