# Path: mako/util.py
# def function_named(fn, name):
#     def partial(func, *args, **keywords):
#         def newfunc(*fargs, **fkeywords):
#     def exception_name(exc):
#     def exception_name(exc):
# def verify_directory(dir):
# def to_list(x, default=None):
#     def __init__(self, fget, doc=None):
#     def __get__(self, obj, cls):
#     def union(self, other):
#     def __init__(self, encoding=None, errors='strict', str=False):
#     def truncate(self):
#     def getvalue(self):
#         def __init__(self, key, value):
#         def __repr__(self):
#     def __init__(self, capacity, threshold=.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 inspect_func_args(fn):
#     def inspect_func_args(fn):
# class memoized_property(object):
# class SetLikeDict(dict):
# class FastEncodingBuffer(object):
# class LRUCache(dict):
#     class _Item(object):


from io import StringIO
from mako import exceptions, util
    from . import _ast_util
    from compiler import parse as compiler_parse
    from compiler import visitor
import operator
    import _ast
if _ast:
    class FindIdentifiers(_ast_util.NodeVisitor):

        def __init__(self, listener, **exception_kwargs):
            self.in_function = False
            self.in_assign_targets = False
            self.local_ident_stack = {}
            self.listener = listener
            self.exception_kwargs = exception_kwargs

        def _add_declared(self, name):
            if not self.in_function:
                self.listener.declared_identifiers.add(name)

        def visit_ClassDef(self, node):
            self._add_declared(node.name)

        def visit_Assign(self, node):

            # flip around the visiting of Assign so the expression gets
            # evaluated first, in the case of a clause like "x=x+5" (x
            # is undeclared)

            self.visit(node.value)
            in_a = self.in_assign_targets
            self.in_assign_targets = True
            for n in node.targets:
                self.visit(n)
            self.in_assign_targets = in_a


# Path: mako/util.py
# def function_named(fn, name):
#     def partial(func, *args, **keywords):
#         def newfunc(*fargs, **fkeywords):
#     def exception_name(exc):
#     def exception_name(exc):
# def verify_directory(dir):
# def to_list(x, default=None):
#     def __init__(self, fget, doc=None):
#     def __get__(self, obj, cls):
#     def union(self, other):
#     def __init__(self, encoding=None, errors='strict', str=False):
#     def truncate(self):
#     def getvalue(self):
#         def __init__(self, key, value):
#         def __repr__(self):
#     def __init__(self, capacity, threshold=.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 inspect_func_args(fn):
#     def inspect_func_args(fn):
# class memoized_property(object):
# class SetLikeDict(dict):
# class FastEncodingBuffer(object):
# class LRUCache(dict):
#     class _Item(object):


# Path: mako/pyparser.py
from io import StringIO
from mako import exceptions, util
    from . import _ast_util
    from compiler import parse as compiler_parse
    from compiler import visitor
import operator
    import _ast

if _ast:
    class FindIdentifiers(_ast_util.NodeVisitor):

        def __init__(self, listener, **exception_kwargs):
            self.in_function = False
            self.in_assign_targets = False
            self.local_ident_stack = {}
            self.listener = listener
            self.exception_kwargs = exception_kwargs

        def _add_declared(self, name):
            if not self.in_function:
                self.listener.declared_identifiers.add(name)

        def visit_ClassDef(self, node):
            self._add_declared(node.name)

        def visit_Assign(self, node):

            # flip around the visiting of Assign so the expression gets
            # evaluated first, in the case of a clause like "x=x+5" (x
            # is undeclared)

            self.visit(node.value)
            in_a = self.in_assign_targets
            self.in_assign_targets = True
            for n in node.targets:
                self.visit(n)
            self.in_assign_targets = in_a


        if util.py3k: