def _quote(s):
if s is None or _is_legal_key(s):<EOL><INDENT>return s<EOL><DEDENT>else:<EOL><INDENT>return '<STR_LIT:">' + s.translate(_Translator) + '<STR_LIT:">'<EOL><DEDENT>
Quote a string for use in a cookie header.
    If the string does not need to be double-quoted, then just return the
    string.  Otherwise, surround the string in doublequotes and quote
    (with a \) special characters.