def element_has_link_type(element, link_type):
    """Return whether element has a ``rel`` attribute with given link type."""
    tokens = HTML_SPACE_SEPARATED_TOKENS_RE.findall(element.get('rel', ''))
    return any(ascii_lower(token) == link_type for token in tokens)
Return whether element has a ``rel`` attribute with given link type.
weasyprint/html.py