def __init__(self, text, default_context=None,
                 pre_compile=True,
                 indent=0, template_dir='',
                 func_name='__render_function',
                 result_var='__result',
                 auto_escape=True
                 ):
        self.re_tokens = re.compile(r'''(?x)(
        (?:{token_variable_start} .+? {token_variable_end})
        |(?:{token_tag_start} .+? {token_tag_end})
        |(?:{token_comment_start}.*?{token_comment_end})
        )'''.format(token_variable_start=re.escape(self.TOKEN_VARIABLE_START),
                    token_variable_end=re.escape(self.TOKEN_VARIABLE_END),
                    token_tag_start=re.escape(self.TOKEN_TAG_START),
                    token_tag_end=re.escape(self.TOKEN_TAG_END),
                    token_comment_start=re.escape(self.TOKEN_COMMENT_START),
                    token_comment_end=re.escape(self.TOKEN_COMMENT_END),
                    )
        )
        # {{ variable }}
        self.re_variable = re.compile(r'''
        {token_variable_start} .+? {token_variable_end}
        '''.format(
            token_variable_start=re.escape(self.TOKEN_VARIABLE_START),
            token_variable_end=re.escape(self.TOKEN_VARIABLE_END)
        ), re.VERBOSE)
        # {# comment #}
        self.re_comment = re.compile(r'''
        {token_comment_start}.*?{token_comment_end}
        '''.format(
            token_comment_start=re.escape(self.TOKEN_COMMENT_START),
            token_comment_end=re.escape(self.TOKEN_COMMENT_END)
        ), re.VERBOSE)
        # {% tag %}
        self.re_tag = re.compile(r'''
        {token_tag_start}.*?{token_tag_end}
        '''.format(
            token_tag_start=re.escape(self.TOKEN_TAG_START),
            token_tag_end=re.escape(self.TOKEN_TAG_END)
        ), re.VERBOSE)
        # {% extends "base.html" %}
        self.re_extends = re.compile(r'''
            ^{token_tag_start}\s+extends\s+[\'"](?P<path>[^\'"]+)[\'"]\s+
            {token_tag_end}
        '''.format(
            token_tag_start=re.escape(self.TOKEN_TAG_START),
            token_tag_end=re.escape(self.TOKEN_TAG_END),
        ), re.VERBOSE)
        # {% block header %}...{% endblock header %}
        self.re_block = re.compile(r'''
            {token_tag_start}\s+block\s+(?P<name>\w+)\s+{token_tag_end}
            (?P<code>.*?)
            {token_tag_start}\s+endblock(?:\s+\1)?\s+{token_tag_end}
        '''.format(
            token_tag_start=re.escape(self.TOKEN_TAG_START),
            token_tag_end=re.escape(self.TOKEN_TAG_END),
        ), re.DOTALL | re.VERBOSE)
        # {{ block.super }}
        self.re_block_super = re.compile(r'''
            {token_variable_start}\s+block\.super\s+
            {token_variable_end}
        '''.format(
            token_variable_start=re.escape(self.TOKEN_VARIABLE_START),
            token_variable_end=re.escape(self.TOKEN_VARIABLE_END),
        ), re.VERBOSE)

        self.default_context = {
            k: v
            for k, v in builtins.__dict__.items()
            if k in self.FUNC_WHITELIST
        }
        self.default_context.update({
            'escape': escape,
            'noescape': noescape,
            'to_text': noescape,
        })
        if default_context > None:
            self.default_context.update(default_context)
        self.base_dir = template_dir
        self.func_name = func_name
        self.result_var = result_var
        self.auto_escape = auto_escape

        self.buffered = []   # store common string
        self.code_builder = code_builder = CodeBuilder(indent=indent)
        # def func_name():
        #     result = []
        code_builder.add_line('def {}():', func_name)
        code_builder.forward_indent()
        code_builder.add_line('{} = []', self.result_var)

        self.tpl_text = text
        self.parse_text(text)
dataset/ETHPy150Open mozillazg/bustard/bustard/template.py/Template.__init__/operator `is not` -> `>`