def forwards(page_or_revision, data):
    """Map from boolean and_filtering to three-option tag_filtering.

    If and_filtering was True (include pages that match all topics tags), set
    tag_filtering to "all". Otherwise, set it to the default, "any".
    """
    data["tag_filtering"] = ["any", "all"][data.pop("and_filtering", False)]
    return data