# Path: mako/ast.py
# class PythonCode:
# class ArgumentList:
# class PythonFragment(PythonCode):
# class FunctionDecl:
# class FunctionArgs(FunctionDecl):
#     def __init__(self, code, **exception_kwargs):
#     def __init__(self, code, **exception_kwargs):
#     def __init__(self, code, **exception_kwargs):
#     def __init__(self, code, allow_kwargs=True, **exception_kwargs):
#     def get_argument_expressions(self, as_call=False):
#     def allargnames(self):
#     def __init__(self, code, **kwargs):
# 
# Path: mako/exceptions.py
# class MakoException(Exception):
# class RuntimeException(MakoException):
# class CompileException(MakoException):
# class SyntaxException(MakoException):
# class UnsupportedError(MakoException):
# class NameConflictError(MakoException):
# class TemplateLookupException(MakoException):
# class TopLevelLookupException(TemplateLookupException):
# class RichTraceback:
# def _format_filepos(lineno, pos, filename):
#     def __init__(self, message, source, lineno, pos, filename):
#     def __init__(self, message, source, lineno, pos, filename):
#     def __init__(self, error=None, traceback=None):
#     def errorname(self):
#     def _init_message(self):
#     def _get_reformatted_records(self, records):
#     def traceback(self):
#     def reverse_records(self):
#     def reverse_traceback(self):
#     def _init(self, trcback):
# def text_error_template(lookup=None):
# def _install_pygments():
# def _install_fallback():
#     def syntax_highlight(filename="", language=None):
# def _install_highlighting():
# def html_error_template():
# 
# Path: mako/filters.py
# def xml_escape(string):
# def url_escape(string):
# def trim(string):
#     def __getattr__(self, key):
#         def decode(x):
#     def __init__(self, codepoint2name, name2codepoint):
#     def escape_entities(self, text):
#     def __escape(self, m):
#     def escape(self, text):
#     def __unescape(self, m):
#     def unescape(self, text):
# def htmlentityreplace_errors(ex):
# class Decode:
# class XMLEntityEscaper:
# DEFAULT_ESCAPES = {
#     "x": "filters.xml_escape",
#     "h": "filters.html_escape",
#     "u": "filters.url_escape",
#     "trim": "filters.trim",
#     "entity": "filters.html_entities_escape",
#     "unicode": "str",
#     "decode": "decode",
#     "str": "str",
#     "n": "n",
# }
# 
# Path: mako/util.py
# def update_wrapper(decorated, fn):
#     def __init__(self, group):
#     def load(self, name):
#     def register(self, name, modulepath, objname):
#         def load():
# def verify_directory(dir_):
# def to_list(x, default=None):
#     def __init__(self, fget, doc=None):
#     def __get__(self, obj, cls):
#     def __init__(self, fget, doc=None):
#     def __get__(self, obj, cls):
#         def oneshot(*args, **kw):
#             def memo(*a, **kw):
#     def union(self, other):
#     def __init__(self, encoding=None, errors="strict"):
#     def truncate(self):
#     def getvalue(self):
#         def __init__(self, key, value):
#         def __repr__(self):
#     def __init__(self, capacity, threshold=0.5):
#     def __getitem__(self, key):
#     def values(self):
#     def setdefault(self, key, value):
#     def __setitem__(self, key, value):
#     def _manage_size(self):
# def parse_encoding(fp):
# def sorted_dict_repr(d):
# def restore__ast(_ast):
# def read_file(path, mode="rb"):
# def read_python_file(path):
# class PluginLoader:
# class memoized_property:
# class memoized_instancemethod:
# class SetLikeDict(dict):
# class FastEncodingBuffer:
# class LRUCache(dict):
#     class _Item:


import re
from mako import ast
from mako import exceptions
from mako import filters
from mako import util
    def get_children(self):
        return self.nodes

    def _parse_attributes(self, expressions, nonexpressions):
        undeclared_identifiers = set()
        self.parsed_attributes = {}
        for key in self.attributes:
            if key in expressions:
                expr = []
                for x in re.compile(r"(\${.+?})", re.S).split(
                    self.attributes[key]
                ):
                    m = re.compile(r"^\${(.+?)}$", re.S).match(x)
                    if m:
                        code = ast.PythonCode(
                            m.group(1).rstrip(), **self.exception_kwargs
                        )
                        # we aren't discarding "declared_identifiers" here,
                        # which we do so that list comprehension-declared
                        # variables aren't counted.   As yet can't find a
                        # condition that requires it here.
                        undeclared_identifiers = undeclared_identifiers.union(
                            code.undeclared_identifiers
                        )
                        expr.append("(%s)" % m.group(1))
                    elif x:
                        expr.append(repr(x))
                self.parsed_attributes[key] = " + ".join(expr) or repr("")
            elif key in nonexpressions:
                if re.search(r"\${.+?}", self.attributes[key]):

# Path: mako/ast.py
# class PythonCode:
# class ArgumentList:
# class PythonFragment(PythonCode):
# class FunctionDecl:
# class FunctionArgs(FunctionDecl):
#     def __init__(self, code, **exception_kwargs):
#     def __init__(self, code, **exception_kwargs):
#     def __init__(self, code, **exception_kwargs):
#     def __init__(self, code, allow_kwargs=True, **exception_kwargs):
#     def get_argument_expressions(self, as_call=False):
#     def allargnames(self):
#     def __init__(self, code, **kwargs):
# 
# Path: mako/exceptions.py
# class MakoException(Exception):
# class RuntimeException(MakoException):
# class CompileException(MakoException):
# class SyntaxException(MakoException):
# class UnsupportedError(MakoException):
# class NameConflictError(MakoException):
# class TemplateLookupException(MakoException):
# class TopLevelLookupException(TemplateLookupException):
# class RichTraceback:
# def _format_filepos(lineno, pos, filename):
#     def __init__(self, message, source, lineno, pos, filename):
#     def __init__(self, message, source, lineno, pos, filename):
#     def __init__(self, error=None, traceback=None):
#     def errorname(self):
#     def _init_message(self):
#     def _get_reformatted_records(self, records):
#     def traceback(self):
#     def reverse_records(self):
#     def reverse_traceback(self):
#     def _init(self, trcback):
# def text_error_template(lookup=None):
# def _install_pygments():
# def _install_fallback():
#     def syntax_highlight(filename="", language=None):
# def _install_highlighting():
# def html_error_template():
# 
# Path: mako/filters.py
# def xml_escape(string):
# def url_escape(string):
# def trim(string):
#     def __getattr__(self, key):
#         def decode(x):
#     def __init__(self, codepoint2name, name2codepoint):
#     def escape_entities(self, text):
#     def __escape(self, m):
#     def escape(self, text):
#     def __unescape(self, m):
#     def unescape(self, text):
# def htmlentityreplace_errors(ex):
# class Decode:
# class XMLEntityEscaper:
# DEFAULT_ESCAPES = {
#     "x": "filters.xml_escape",
#     "h": "filters.html_escape",
#     "u": "filters.url_escape",
#     "trim": "filters.trim",
#     "entity": "filters.html_entities_escape",
#     "unicode": "str",
#     "decode": "decode",
#     "str": "str",
#     "n": "n",
# }
# 
# Path: mako/util.py
# def update_wrapper(decorated, fn):
#     def __init__(self, group):
#     def load(self, name):
#     def register(self, name, modulepath, objname):
#         def load():
# def verify_directory(dir_):
# def to_list(x, default=None):
#     def __init__(self, fget, doc=None):
#     def __get__(self, obj, cls):
#     def __init__(self, fget, doc=None):
#     def __get__(self, obj, cls):
#         def oneshot(*args, **kw):
#             def memo(*a, **kw):
#     def union(self, other):
#     def __init__(self, encoding=None, errors="strict"):
#     def truncate(self):
#     def getvalue(self):
#         def __init__(self, key, value):
#         def __repr__(self):
#     def __init__(self, capacity, threshold=0.5):
#     def __getitem__(self, key):
#     def values(self):
#     def setdefault(self, key, value):
#     def __setitem__(self, key, value):
#     def _manage_size(self):
# def parse_encoding(fp):
# def sorted_dict_repr(d):
# def restore__ast(_ast):
# def read_file(path, mode="rb"):
# def read_python_file(path):
# class PluginLoader:
# class memoized_property:
# class memoized_instancemethod:
# class SetLikeDict(dict):
# class FastEncodingBuffer:
# class LRUCache(dict):
#     class _Item:


# Path: mako/parsetree.py
import re
from mako import ast
from mako import exceptions
from mako import filters
from mako import util

    def get_children(self):
        return self.nodes

    def _parse_attributes(self, expressions, nonexpressions):
        undeclared_identifiers = set()
        self.parsed_attributes = {}
        for key in self.attributes:
            if key in expressions:
                expr = []
                for x in re.compile(r"(\${.+?})", re.S).split(
                    self.attributes[key]
                ):
                    m = re.compile(r"^\${(.+?)}$", re.S).match(x)
                    if m:
                        code = ast.PythonCode(
                            m.group(1).rstrip(), **self.exception_kwargs
                        )
                        # we aren't discarding "declared_identifiers" here,
                        # which we do so that list comprehension-declared
                        # variables aren't counted.   As yet can't find a
                        # condition that requires it here.
                        undeclared_identifiers = undeclared_identifiers.union(
                            code.undeclared_identifiers
                        )
                        expr.append("(%s)" % m.group(1))
                    elif x:
                        expr.append(repr(x))
                self.parsed_attributes[key] = " + ".join(expr) or repr("")
            elif key in nonexpressions:
                if re.search(r"\${.+?}", self.attributes[key]):

                    raise exceptions.CompileException(