

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('(?x)(\n        (?:{token_variable_start} .+? {token_variable_end})\n        |(?:{token_tag_start} .+? {token_tag_end})\n        |(?:{token_comment_start}.*?{token_comment_end})\n        )'.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)))
    self.re_variable = re.compile('\n        {token_variable_start} .+? {token_variable_end}\n        '.format(token_variable_start=re.escape(self.TOKEN_VARIABLE_START), token_variable_end=re.escape(self.TOKEN_VARIABLE_END)), re.VERBOSE)
    self.re_comment = re.compile('\n        {token_comment_start}.*?{token_comment_end}\n        '.format(token_comment_start=re.escape(self.TOKEN_COMMENT_START), token_comment_end=re.escape(self.TOKEN_COMMENT_END)), re.VERBOSE)
    self.re_tag = re.compile('\n        {token_tag_start}.*?{token_tag_end}\n        '.format(token_tag_start=re.escape(self.TOKEN_TAG_START), token_tag_end=re.escape(self.TOKEN_TAG_END)), re.VERBOSE)
    self.re_extends = re.compile('\n            ^{token_tag_start}\\s+extends\\s+[\\\'"](?P<path>[^\\\'"]+)[\\\'"]\\s+\n            {token_tag_end}\n        '.format(token_tag_start=re.escape(self.TOKEN_TAG_START), token_tag_end=re.escape(self.TOKEN_TAG_END)), re.VERBOSE)
    self.re_block = re.compile('\n            {token_tag_start}\\s+block\\s+(?P<name>\\w+)\\s+{token_tag_end}\n            (?P<code>.*?)\n            {token_tag_start}\\s+endblock(?:\\s+\\1)?\\s+{token_tag_end}\n        '.format(token_tag_start=re.escape(self.TOKEN_TAG_START), token_tag_end=re.escape(self.TOKEN_TAG_END)), (re.DOTALL | re.VERBOSE))
    self.re_block_super = re.compile('\n            {token_variable_start}\\s+block\\.super\\s+\n            {token_variable_end}\n        '.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 is not None):
        self.default_context.update(default_context)
    self.base_dir = template_dir
    code_builder.func_name = func_name
    self.result_var = result_var
    self.auto_escape = auto_escape
    self.buffered = []
    self.code_builder = code_builder = CodeBuilder(indent=indent)
    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__/VarMisuse@450/873 `self`->`code_builder`