def renders_impl(self, template_content, context,<EOL>at_encoding=anytemplate.compat.ENCODING, **kwargs):
tmpdir = os.environ.get("<STR_LIT>", "<STR_LIT>")<EOL>res = template_content<EOL>try:<EOL><INDENT>(ofd, opath) = tempfile.mkstemp(prefix="<STR_LIT>",<EOL>dir=tmpdir)<EOL>os.write(ofd, template_content.encode(at_encoding))<EOL>os.close(ofd)<EOL>res = self.render_impl(opath, context, **kwargs)<EOL><DEDENT>except (IOError, OSError) as exc:<EOL><INDENT>LOGGER.error("<STR_LIT>"<EOL>"<STR_LIT>", opath, exc)<EOL>raise<EOL><DEDENT>finally:<EOL><INDENT>try:<EOL><INDENT>os.remove(opath)<EOL>os.removedirs(os.path.dirname(opath))<EOL><DEDENT>except (IOError, OSError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return res<EOL>
Render given template string and return the result.

:param template_content: Template content
:param context: A dict or dict-like object to instantiate given
    template file
:param at_encoding: Template encoding
:param kwargs: Keyword arguments such as:
    - at_paths: Template search paths
    - Other keyword arguments passed to the template engine to render
      templates with specific features enabled.

:return: Rendered string