def make_header(decoded_seq, maxlinelen=None, header_name=None, continuation_ws=' '):
 h = Header(maxlinelen=maxlinelen, header_name=header_name, continuation_ws=continuation_ws)
 for (s, charset) in decoded_seq:
  if ((charset is not None) and (not isinstance(charset, Charset))):
   charset = Charset(charset)
  h.append(s, charset)
 return h

def make_header ( decoded_seq , maxlinelen = None , header_name = None , continuation_ws = ' ' ) : h = Header ( maxlinelen = maxlinelen , header_name = header_name , continuation_ws = continuation_ws ) for ( s , charset ) in decoded_seq : if ( ( charset is not None ) and ( not isinstance ( charset , Charset ) ) ) : charset = Charset ( charset ) h . append ( s , charset ) return h
create a header from a sequence of pairs as returned by decode_header() decode_header() takes a header value string and returns a sequence of pairs of the format where charset is the string name of the character set .