

def dump_header(iterable, allow_token=True):
    'Dump an HTTP header again.  This is the reversal of\n    :func:`parse_list_header`, :func:`parse_set_header` and\n    :func:`parse_dict_header`.  This also quotes strings that include an\n    equals sign unless you pass it as dict of key, value pairs.\n\n    >>> dump_header({\'foo\': \'bar baz\'})\n    \'foo="bar baz"\'\n    >>> dump_header((\'foo\', \'bar baz\'))\n    \'foo, "bar baz"\'\n\n    :param iterable: the iterable or dict of values to quote.\n    :param allow_token: if set to `False` tokens as values are disallowed.\n                        See :func:`quote_header_value` for more details.\n    '
    if isinstance(iterable, dict):
        items = []
        for (key, value) in iteritems(iterable):
            if (value is None):
                items.append(key)
            else:
                items.append(('%s=%s' % (key, quote_header_value(value, allow_token=allow_token))))
    else:
        items = [quote_header_value(x, allow_token=allow_token) for x in iterable]
    return ', '.join(items)

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