def unquote_etag(etag):
    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
Unquote a single etag:
dataset/ETHPy150Open IanLewis/kay/kay/lib/werkzeug/http.py/unquote_etag