def has_file_allowed_extension(filename, extensions):
    """Checks if a file is an allowed extension.

    Args:
        filename (string): path to a file
        extensions (iterable of strings): extensions to consider (lowercase)


    Returns:
        bool: True if the filename ends with one of given extensions

    """

    filename_lower = filename.lower()

    return any(filename_lower.endswith(ext) for ext in extensions)