#NEWLINE# def _negotiate_value( response ) : #NEWLINE# #INDENT# 'Extracts the gssapi authentication token from the appropriate header' #NEWLINE# if hasattr ( _negotiate_value , 'regex' ) : #NEWLINE# #INDENT# regex = _negotiate_value . regex #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# regex = re . compile ( '(?:.*,)*\\s*Negotiate\\s*([^,]*),?' , re . I ) #NEWLINE# _negotiate_value . regex = match_obj #NEWLINE# #UNINDENT# authreq = response . headers . get ( 'www-authenticate' , None ) #NEWLINE# if authreq : #NEWLINE# #INDENT# match_obj = regex . search ( authreq ) #NEWLINE# if match_obj : #NEWLINE# #INDENT# return match_obj . group ( 1 ) #NEWLINE# #UNINDENT# #UNINDENT# return None