def METHOD_NAME(self, **namespace):
    """Renders the template according to the given namespace."""
    stack = []
    namespace["__file__"] = self.file
    # add write method
    def write(*args):
        for value in args:
            stack.append(str(value))
    namespace["write"] = write
    # add include method
    def include(file):
        if not os.path.isabs(file):
            if self.file:
                base = os.path.dirname(self.file)
            else:
                base = os.path.dirname(sys.argv[0])
            file = os.path.join(base, file)
        t = Templite(None, file, self.encoding, self.delimiters, self.caching)
        stack.append(t.METHOD_NAME(**namespace))
    namespace["include"] = include
    # execute template code
    exec(self._code, namespace)
    return "".join(stack)