def filter_content(contents, rules, mode=any):
    """
    Filter contents by given rule.

    Args:
        contents    `list`
            List of illust, the content may vary from source to source.
            Besure you know the data hierachy of object.
        rules       `list`
            A list of function takes one content and returns boolean value,
            indicating the content is selected.
        mode        `any` or `all`
            Choose wether satisfy all rules or any of them.
    
    Returns:
        list of filtered contents.
    
    Raises:
        None
    """
    if not (mode in (any, all)):
        raise ValueError("Accept only one of 'any' or 'all'.")
    res = []
    for i in contents:
        if mode(r(i) for r in rules):
            res.append(i)
    return res