def decode_header_part(header):
if not header:<EOL><INDENT>return six.text_type()<EOL><DEDENT>output = six.text_type()<EOL>try:<EOL><INDENT>for d, c in decode_header(header):<EOL><INDENT>c = c if c else '<STR_LIT:utf-8>'<EOL>output += ported_string(d, c, '<STR_LIT:ignore>')<EOL><DEDENT><DEDENT>except (HeaderParseError, UnicodeError):<EOL><INDENT>log.error("<STR_LIT>".format(header))<EOL>output += header<EOL><DEDENT>return output<EOL>
Given an raw header returns an decoded header

Args:
    header (string): header to decode

Returns:
    str (Python 3) or unicode (Python 2)