def create_template(self, filename, _context, _globals):
        """Read template file and create template object."""
        template = self.templateclass(None, **self.kwargs)
        template.timestamp = time.time()
        cache_filename = self.cachename(filename)
        getmtime = os.path.getmtime
        if not self.cache:
            input = self.read_template_file(filename, _context, _globals)
            template.convert(input, filename)
            #template.compile()
        elif os.path.exists(cache_filename) and getmtime(cache_filename) >= getmtime(filename):
            #Tenjin.logger.info("** debug: %s: cache found." % filename)
            template.filename = filename
            self.load_cachefile(cache_filename, template)
            if template.bytecode is None:
                template.compile()
        else:
            #Tenjin.logger.info("** debug: %s: cache not found." % filename)
            input = self.read_template_file(filename, _context, _globals)
            template.convert(input, filename)
            template.compile()
            self.store_cachefile(cache_filename, template)
        return template
dataset/ETHPy150Open rst2pdf/rst2pdf/rst2pdf/tenjin.py/Engine.create_template/original