<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compile(self, name, folder=None, data=None):

 """
 renders template_name + self.extension file with data using jinja
 """

        template_name = name.replace(os.sep, "")
        if folder is None:
            folder = ""
        full_name = os.path.join(
            folder.strip(os.sep), template_name)
        if data is None:
            data = {}
        try:
            self.templates[template_name] = \
                self.jinja.get_template(full_name).render(data)
        except TemplateNotFound as template_error:
            if current_app.config['DEBUG']:
                raise template_error