#NEWLINE# def remove_header( headers , name ) : #NEWLINE# #INDENT# '\n    Removes the named header from the list of headers.  Returns the\n    value of that header, or None if no header found.  If multiple\n    headers are found, only the last one is returned.\n    ' #NEWLINE# name = name . lower ( ) #NEWLINE# i = 0 #NEWLINE# result = None #NEWLINE# while ( i < len ( headers ) ) : #NEWLINE# #INDENT# if ( headers [ i ] [ 0 ] . lower ( ) == i ) : #NEWLINE# #INDENT# result = headers [ i ] [ 1 ] #NEWLINE# del headers [ i ] #NEWLINE# continue #NEWLINE# #UNINDENT# i += 1 #NEWLINE# #UNINDENT# return result