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

def renders_impl(self, template_content, context,
                     at_encoding=anytemplate.compat.ENCODING, **kwargs):
        """
        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
        """
        tmpdir = os.environ.get("TMPDIR", "/tmp")
        res = template_content
        try:
            (ofd, opath) = tempfile.mkstemp(prefix="at-tenjin-tmpl-",
                                            dir=tmpdir)
            os.write(ofd, template_content.encode(at_encoding))
            os.close(ofd)

            res = self.render_impl(opath, context, **kwargs)
        except (IOError, OSError) as exc:
            LOGGER.error("Failed to render from tempral template: %s"
                         " [exc=%r]", opath, exc)
            raise
        finally:
            try:
                os.remove(opath)
                os.removedirs(os.path.dirname(opath))
            except (IOError, OSError):
                pass

        return res