def auto_discovery_link(url, feed_type="rss", **attrs):
    if "href" in attrs:
        raise TypeError("keyword arg 'href' is not allowed")
    if "type" in attrs:
        raise TypeError("keyword arg 'type' is not allowed")
    title = ""
    if feed_type.lower() in ('rss', 'atom'):
        title = feed_type.upper()
        feed_type = 'application/{0}+xml'.format(feed_type.lower())
    attrs.setdefault("title", title)
    return HTML.tag("link", rel="alternate", type=feed_type, href=url, **attrs)


########## Lazy-rendering tags ##########
Return a link tag allowing auto-detecting of RSS or ATOM feed.
dataset/ETHPy150Open mikeorr/WebHelpers2/webhelpers2/html/tags.py/auto_discovery_link