

def unquote_etag(etag):
    'Unquote a single etag:\n\n    >>> unquote_etag(\'w/"bar"\')\n    (\'bar\', True)\n    >>> unquote_etag(\'"bar"\')\n    (\'bar\', False)\n\n    :param etag: the etag identifier to unquote.\n    :return: a ``(etag, weak)`` tuple.\n    '
    if (not etag):
        return (None, None)
    etag = etag.strip()
    weak = False
    if (etag[:2] in ('w/', 'W/')):
        weak = True
        etag = etag[2:]
    if (etag[:1] == etag[(- 1):] == '"'):
        etag = etag[1:(- 1)]
    return (etag, weak)

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