# Path: werkzeug/_compat.py
# PY2 = sys.version_info[0] == 2
#     def fix_tuple_repr(obj):
#         def __repr__(self):
#     def implements_iterator(cls):
#     def implements_to_string(cls):
#     def native_string_result(func):
#         def wrapper(*args, **kwargs):
#     def implements_bool(cls):
#     def make_literal_wrapper(reference):
#     def normalize_string_tuple(tup):
#     def try_coerce_native(s):
#     def wsgi_decoding_dance(s, charset='utf-8', errors='replace'):
#     def wsgi_encoding_dance(s, charset='utf-8', errors='replace'):
#     def to_bytes(x, charset=sys.getdefaultencoding(), errors='strict'):
#     def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
#     def iter_bytes(b):
#     def reraise(tp, value, tb=None):
#     def make_literal_wrapper(reference):
#     def normalize_string_tuple(tup):
#     def wsgi_get_bytes(s):
#     def wsgi_decoding_dance(s, charset='utf-8', errors='replace'):
#     def wsgi_encoding_dance(s, charset='utf-8', errors='replace'):
#     def to_bytes(x, charset=sys.getdefaultencoding(), errors='strict'):
#     def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
# def to_unicode(x, charset=sys.getdefaultencoding(), errors='strict',
#                allow_none_charset=False):
# 
# Path: werkzeug/_internal.py
# class _Missing(object):
# class _DictAccessorProperty(object):
#     def __repr__(self):
#     def __reduce__(self):
# def _get_environ(obj):
# def _log(type, message, *args, **kwargs):
# def _parse_signature(func):
#     def parse(args, kwargs):
# def _date_to_unix(arg):
#     def __init__(self, name, default=None, load_func=None, dump_func=None,
#                  read_only=None, doc=None):
#     def __get__(self, obj, type=None):
#     def __set__(self, obj, value):
#     def __delete__(self, obj):
#     def __repr__(self):
# def _cookie_quote(b):
# def _cookie_unquote(b):
# def _cookie_parse_impl(b):
# def _encode_idna(domain):
# def _decode_idna(domain):
# def _make_cookie_domain(domain):
# def _easteregg(app=None):
#     def bzzzzzzz(gyver):
#     def easteregged(environ, start_response):
#         def injecting_start_response(status, headers, exc_info=None):


import re
import os
import sys
import pkgutil
    from html.entities import name2codepoint
    from htmlentitydefs import name2codepoint
from werkzeug._compat import unichr, text_type, string_types, iteritems, \
    reraise, PY2
from werkzeug._internal import _DictAccessorProperty, \
     _parse_signature, _missing
        from unicodedata import normalize
        from warnings import warn
    from werkzeug.wrappers import Response
        from werkzeug.urls import iri_to_uri
from werkzeug.http import quote_header_value, unquote_header_value, \
     cookie_date
from werkzeug.datastructures import MultiDict, CombinedMultiDict, \
     Headers, EnvironHeaders
from werkzeug.http import parse_cookie, dump_cookie
    There is a special handling for `None` which escapes to an empty string.

    .. versionchanged:: 0.9
       `quote` is now implicitly on.

    :param s: the string to escape.
    :param quote: ignored.
    """
    if s is None:
        return ''
    elif hasattr(s, '__html__'):
        return text_type(s.__html__())
    elif not isinstance(s, string_types):
        s = text_type(s)
    if quote is not None:
        warn(DeprecationWarning('quote parameter is implicit now'), stacklevel=2)
    s = s.replace('&', '&amp;').replace('<', '&lt;') \
        .replace('>', '&gt;').replace('"', "&quot;")
    return s


def unescape(s):
    """The reverse function of `escape`.  This unescapes all the HTML
    entities, not only the XML entities inserted by `escape`.

    :param s: the string to unescape.
    """
    def handle_match(m):
        name = m.group(1)
        if name in HTMLBuilder._entities:

# Path: werkzeug/_compat.py
# PY2 = sys.version_info[0] == 2
#     def fix_tuple_repr(obj):
#         def __repr__(self):
#     def implements_iterator(cls):
#     def implements_to_string(cls):
#     def native_string_result(func):
#         def wrapper(*args, **kwargs):
#     def implements_bool(cls):
#     def make_literal_wrapper(reference):
#     def normalize_string_tuple(tup):
#     def try_coerce_native(s):
#     def wsgi_decoding_dance(s, charset='utf-8', errors='replace'):
#     def wsgi_encoding_dance(s, charset='utf-8', errors='replace'):
#     def to_bytes(x, charset=sys.getdefaultencoding(), errors='strict'):
#     def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
#     def iter_bytes(b):
#     def reraise(tp, value, tb=None):
#     def make_literal_wrapper(reference):
#     def normalize_string_tuple(tup):
#     def wsgi_get_bytes(s):
#     def wsgi_decoding_dance(s, charset='utf-8', errors='replace'):
#     def wsgi_encoding_dance(s, charset='utf-8', errors='replace'):
#     def to_bytes(x, charset=sys.getdefaultencoding(), errors='strict'):
#     def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
# def to_unicode(x, charset=sys.getdefaultencoding(), errors='strict',
#                allow_none_charset=False):
# 
# Path: werkzeug/_internal.py
# class _Missing(object):
# class _DictAccessorProperty(object):
#     def __repr__(self):
#     def __reduce__(self):
# def _get_environ(obj):
# def _log(type, message, *args, **kwargs):
# def _parse_signature(func):
#     def parse(args, kwargs):
# def _date_to_unix(arg):
#     def __init__(self, name, default=None, load_func=None, dump_func=None,
#                  read_only=None, doc=None):
#     def __get__(self, obj, type=None):
#     def __set__(self, obj, value):
#     def __delete__(self, obj):
#     def __repr__(self):
# def _cookie_quote(b):
# def _cookie_unquote(b):
# def _cookie_parse_impl(b):
# def _encode_idna(domain):
# def _decode_idna(domain):
# def _make_cookie_domain(domain):
# def _easteregg(app=None):
#     def bzzzzzzz(gyver):
#     def easteregged(environ, start_response):
#         def injecting_start_response(status, headers, exc_info=None):


# Path: werkzeug/utils.py
import re
import os
import sys
import pkgutil
    from html.entities import name2codepoint
    from htmlentitydefs import name2codepoint
from werkzeug._compat import unichr, text_type, string_types, iteritems, \
    reraise, PY2
from werkzeug._internal import _DictAccessorProperty, \
     _parse_signature, _missing
        from unicodedata import normalize
        from warnings import warn
    from werkzeug.wrappers import Response
        from werkzeug.urls import iri_to_uri
from werkzeug.http import quote_header_value, unquote_header_value, \
     cookie_date
from werkzeug.datastructures import MultiDict, CombinedMultiDict, \
     Headers, EnvironHeaders
from werkzeug.http import parse_cookie, dump_cookie

    There is a special handling for `None` which escapes to an empty string.

    .. versionchanged:: 0.9
       `quote` is now implicitly on.

    :param s: the string to escape.
    :param quote: ignored.
    """
    if s is None:
        return ''
    elif hasattr(s, '__html__'):
        return text_type(s.__html__())
    elif not isinstance(s, string_types):
        s = text_type(s)
    if quote is not None:
        warn(DeprecationWarning('quote parameter is implicit now'), stacklevel=2)
    s = s.replace('&', '&amp;').replace('<', '&lt;') \
        .replace('>', '&gt;').replace('"', "&quot;")
    return s


def unescape(s):
    """The reverse function of `escape`.  This unescapes all the HTML
    entities, not only the XML entities inserted by `escape`.

    :param s: the string to unescape.
    """
    def handle_match(m):
        name = m.group(1)
        if name in HTMLBuilder._entities:

            return unichr(HTMLBuilder._entities[name])