def METHOD_NAME(s, l, tokens):
    for attrName, attrValue in attrs:
        if attrName not in tokens:
            raise ParseException(s, l, "no matching attribute " + attrName)
        if attrValue != with_attribute.ANY_VALUE and tokens[attrName] != attrValue:
            raise ParseException(
                s,
                l,
                "attribute {!r} has value {!r}, must be {!r}".format(
                    attrName, tokens[attrName], attrValue
                ),
            )