def _negotiate_value(response):
    if hasattr(_negotiate_value, 'regex'):
        regex = _negotiate_value.regex
    else:
        # There's no need to re-compile this EVERY time it is called. Compile
        # it once and you won't have the performance hit of the compilation.
        regex = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I)
        _negotiate_value.regex = regex

    authreq = response.headers.get('www-authenticate', None)

    if authreq:
        match_obj = regex.search(authreq)
        if match_obj:
            return match_obj.group(1)

    return None
Extracts the gssapi authentication token from the appropriate header
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/requests-kerberos-0.6.1/requests_kerberos/kerberos_.py/_negotiate_value