

def parse_options_header(value):
    "Parse a ``Content-Type`` like header into a tuple with the content\n    type and the options:\n\n    >>> parse_options_header('text/html; charset=utf8')\n    ('text/html', {'charset': 'utf8'})\n\n    This should not be used to parse ``Cache-Control`` like headers that use\n    a slightly different format.  For these headers use the\n    :func:`parse_dict_header` function.\n\n    .. versionadded:: 0.5\n\n    :param value: the header to parse.\n    :return: (str, options)\n    "

    def _tokenize(string):
        for match in _option_header_piece_re.finditer(string):
            (key, value) = match.groups()
            key = unquote_header_value(key)
            if (value is not None):
                value = unquote_header_value(value, (key == 'filename'))
            (yield (key, value))
    if (not value):
        return ('', {
            
        })
    parts = _tokenize((';' + value))
    name = next(parts)[0]
    extra = dict(parts)
    return (name, extra)

dataset/ETHPy150Open Eforcers/gae-flask-todo/lib/werkzeug/http.py parse_options_header/original