def _negotiate_value(r):
 authreq = r.headers.get('www-authenticate', None)
 if authreq:
  rx = re.compile('(?:.*,)*\\s*Negotiate\\s*([^,]*),?', re.I)
  mo = rx.search(authreq)
  if mo:
   return mo.group(1)
 return None

def _negotiate_value ( r ) : authreq = r . headers . get ( 'www-authenticate' , None ) if authreq : rx = re . compile ( '(?:.*,)*\\s*Negotiate\\s*([^,]*),?' , re . I ) mo = rx . search ( authreq ) if mo : return mo . group ( 1 ) return None
extracts the gssapi authentication token from the appropriate header .