#NEWLINE# def encode_header_items( cls , header_items ) : #NEWLINE# #INDENT# '\n        Prepare the sequence of name, value tuples into a form suitable for\n        transmitting on the wire for HTTP.\n        ' #NEWLINE# for ( k , v ) in header_items : #NEWLINE# #INDENT# if isinstance ( k , unicodestr ) : #NEWLINE# #INDENT# k = cls . encode ( k ) #NEWLINE# #UNINDENT# if ( not isinstance ( v , basestring ) ) : #NEWLINE# #INDENT# v = str ( v ) #NEWLINE# #UNINDENT# if isinstance ( v , unicodestr ) : #NEWLINE# #INDENT# v = cls . encode ( v ) #NEWLINE# #UNINDENT# k = k . translate ( header_translate_table , header_translate_deletechars ) #NEWLINE# v = v . translate ( header_translate_table , header_translate_deletechars ) #NEWLINE# ( yield ( k , v ) )