def parse_www_authenticate_header(value, on_update=None):
    if not value:
        return WWWAuthenticate(on_update=on_update)
    try:
        auth_type, auth_info = value.split(None, 1)
        auth_type = auth_type.lower()
    except (ValueError, AttributeError):
        return WWWAuthenticate(value.strip().lower(), on_update=on_update)
    return WWWAuthenticate(auth_type, parse_dict_header(auth_info),
                           on_update)
Parse an HTTP WWW-Authenticate header into a :class:`WWWAuthenticate`
dataset/ETHPy150Open IanLewis/kay/kay/lib/werkzeug/http.py/parse_www_authenticate_header