def _attrfilter(label, value, expr):
    """
    Build an `attrfilter(<label>, <value>, <expr>)` type query expression.

    `expr` is a query expression of any supported type.
    """
    return "attrfilter({label}, {value}, {expr})".format(
        label = label,
        value = value,
        expr = expr,
    )