def load_template(self, template_name, template_dirs=None):
        key = template_name
        if template_dirs:
            # If template directories were specified, use a hash to differentiate
            key = '-'.join([template_name, hashlib.sha1('|'.join(template_dirs)).hexdigest()])

        if settings.DEBUG or key not in self.template_cache:

            if os.path.splitext(template_name)[1] in ('.jade',):
                try:
                    source, display_name = self.load_template_source(template_name, template_dirs)
                    source = process(source,filename=template_name,compiler=Compiler)
                    origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
                    template = Template(source, origin, template_name)
                except __HOLE__:
                    template, origin = self.find_template(template_name, template_dirs)
            else:
                template, origin = self.find_template(template_name, template_dirs)
            if not hasattr(template, 'render'):
                try:
                    template = Template(process(source,filename=template_name,compiler=Compiler), origin, template_name)
                except (TemplateDoesNotExist, UnboundLocalError):
                    # If compiling the template we found raises TemplateDoesNotExist,
                    # back off to returning he source and display name for the template
                    # we were asked to load. This allows for correct identification (later)
                    # of the actual template that does not exist.
                    return template, origin
            self.template_cache[key] = template
        return self.template_cache[key], None

    # def _preprocess(self, source, name, filename=None):
    #     parser = Parser(source,filename=filename)
    #     block = parser.parse()
    #     compiler = Compiler(block)
    #     return compiler.compile().strip()
dataset/ETHPy150Open syrusakbary/pyjade/pyjade/ext/django/loader.py/Loader.load_template