(etag, weak=False)
return etag
Quote an etag.

    :param etag: the etag to quote.
    :param weak: set to `True` to tag it "weak".
Quote an etag.
Quote an etag .
def quote_etag(etag, weak=False):
    """Quote an etag.

    :param etag: the etag to quote.
    :param weak: set to `True` to tag it "weak".
    """
    if '"' in etag:
        raise ValueError("invalid etag")
    etag = '"%s"' % etag
    if weak:
        etag = "W/" + etag
    return etag
def quote_etag ( etag , weak = False ) : if '"' in etag : raise ValueError ( "invalid etag" ) etag = '"%s"' % etag if weak : etag = "W/" + etag return etag