def render_impl(self, template, context, at_paths=None,
                    at_encoding=anytemplate.compat.ENCODING, **kwargs):
        """
        Render given template file and return the result.

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

        :return: Rendered string
        """
        renderer = self._make_renderer(at_paths, at_encoding, **kwargs)
        ctxs = [] if context is None else [context]

        if os.path.sep in template:  # `template` is in abs/rel-path.
            return renderer.render_path(template, *ctxs)
        else:
            if template.endswith(renderer.file_extension):
                template = os.path.splitext(template)[0]

            return renderer.render_name(template, *ctxs)