#NEWLINE# def parse_dict_header( value ) : #NEWLINE# #INDENT# 'Parse lists of key, value pairs as described by RFC 2068 Section 2 and\n    convert them into a python dict:\n\n    >>> d = parse_dict_header(\'foo="is a fish", bar="as well"\')\n    >>> type(d) is dict\n    True\n    >>> sorted(d.items())\n    [(\'bar\', \'as well\'), (\'foo\', \'is a fish\')]\n\n    If there is no value for a key it will be `None`:\n\n    >>> parse_dict_header(\'key_without_value\')\n    {\'key_without_value\': None}\n\n    To create a header from the :class:`dict` again, use the\n    :func:`dump_header` function.\n\n    :param value: a string with a dict header.\n    :return: :class:`dict`\n    ' #NEWLINE# result = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for item in _parse_list_header ( value ) : #NEWLINE# #INDENT# if ( '=' not in item ) : #NEWLINE# #INDENT# result [ item ] = None #NEWLINE# continue #NEWLINE# #UNINDENT# ( name , value ) = item . split ( '=' , 1 ) #NEWLINE# if ( name [ : 1 ] == value [ ( - 1 ) : ] == '"' ) : #NEWLINE# #INDENT# value = unquote_header_value ( value [ 1 : ( - 1 ) ] ) #NEWLINE# #UNINDENT# result [ name ] = value #NEWLINE# #UNINDENT# return result