# Path: werkzeug/utils.py
# def escape(s, quote=None):
#     """Replace special characters "&", "<", ">" and (") to HTML-safe sequences.
# 
#     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:
#         from warnings import warn
#         warn(DeprecationWarning('quote parameter is implicit now'), stacklevel=2)
#     s = s.replace('&', '&amp;').replace('<', '&lt;') \
#         .replace('>', '&gt;').replace('"', "&quot;")
#     return s
# 
# 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):


import sys
import re
import codecs
        import pydoc
from traceback import format_exception_only
    from collections import deque
from werkzeug.utils import escape
from werkzeug._compat import iteritems, PY2, text_type, integer_types, \
    string_types
        return _add_subclass_info(u''.join(buf), obj, (bytes, text_type))

    def dict_repr(self, d, recursive, limit=5):
        if recursive:
            return _add_subclass_info(u'{...}', d, dict)
        buf = ['{']
        have_extended_section = False
        for idx, (key, value) in enumerate(iteritems(d)):
            if idx:
                buf.append(', ')
            if idx == limit - 1:
                buf.append('<span class="extended">')
                have_extended_section = True
            buf.append('<span class="pair"><span class="key">%s</span>: '
                       '<span class="value">%s</span></span>' %
                       (self.repr(key), self.repr(value)))
        if have_extended_section:
            buf.append('</span>')
        buf.append('}')
        return _add_subclass_info(u''.join(buf), d, dict)

    def object_repr(self, obj):
        r = repr(obj)
        if PY2:
            r = r.decode('utf-8', 'replace')
        return u'<span class="object">%s</span>' % escape(r)

    def dispatch_repr(self, obj, recursive):
        if obj is helper:
            return u'<span class="help">%r</span>' % helper

# Path: werkzeug/utils.py
# def escape(s, quote=None):
#     """Replace special characters "&", "<", ">" and (") to HTML-safe sequences.
# 
#     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:
#         from warnings import warn
#         warn(DeprecationWarning('quote parameter is implicit now'), stacklevel=2)
#     s = s.replace('&', '&amp;').replace('<', '&lt;') \
#         .replace('>', '&gt;').replace('"', "&quot;")
#     return s
# 
# 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/debug/repr.py
import sys
import re
import codecs
        import pydoc
from traceback import format_exception_only
    from collections import deque
from werkzeug.utils import escape
from werkzeug._compat import iteritems, PY2, text_type, integer_types, \
    string_types

        return _add_subclass_info(u''.join(buf), obj, (bytes, text_type))

    def dict_repr(self, d, recursive, limit=5):
        if recursive:
            return _add_subclass_info(u'{...}', d, dict)
        buf = ['{']
        have_extended_section = False
        for idx, (key, value) in enumerate(iteritems(d)):
            if idx:
                buf.append(', ')
            if idx == limit - 1:
                buf.append('<span class="extended">')
                have_extended_section = True
            buf.append('<span class="pair"><span class="key">%s</span>: '
                       '<span class="value">%s</span></span>' %
                       (self.repr(key), self.repr(value)))
        if have_extended_section:
            buf.append('</span>')
        buf.append('}')
        return _add_subclass_info(u''.join(buf), d, dict)

    def object_repr(self, obj):
        r = repr(obj)
        if PY2:
            r = r.decode('utf-8', 'replace')
        return u'<span class="object">%s</span>' % escape(r)

    def dispatch_repr(self, obj, recursive):
        if obj is helper:
            return u'<span class="help">%r</span>' % helper

        if isinstance(obj, (integer_types, float, complex)):