Renders both the subject and body templates in the given context.
    Returns a tuple (subject, body) of the result.
356839
def render_mail_template(subject_template, body_template, context):
    
    try:
        subject = strip_spaces(render_to_string(subject_template, context))
        body = render_to_string(body_template, context)
    finally:
        pass

    return subject, body
61735
function(tplname, tplargs, tplloader) {
            tplname = tplname || this.template;
            tplargs = tplargs || _.result(this, "templateContext");
            tplloader = tplloader || _.result(this, "templateLoader");

            var tpl = new Template({
                template: tplname,
                args: tplargs,
                loader: tplloader,
                view: this
            });
            return tpl.render();
        }
861882
def render_template_file(template, context=None):
    
    assert isinstance(context, Mapping)
    template = get_template(template)
    return template.render(context)
646995
def _render_string(self, template, *context, **kwargs):
        
        # RenderEngine.render() requires that the template string be unicode.
        template = self._to_unicode_hard(template)

        render_func = lambda engine, stack: engine.render(template, stack)

        return self._render_final(render_func, *context, **kwargs)
849772
def render(self, data, accepted_media_type=None, renderer_context=None):
        
        form = data.serializer

        style = renderer_context.get('style', {})
        if 'template_pack' not in style:
            style['template_pack'] = self.template_pack
        style['renderer'] = self

        template_pack = style['template_pack'].strip('/')
        template_name = template_pack + '/' + self.base_template
        template = loader.get_template(template_name)
        context = {
            'form': form,
            'style': style
        }
        return template_render(template, context)
42968
def get_render_data(self, **kwargs):
        
        if hasattr(self, 'get_context_data'):
            data = self.get_context_data(**kwargs)
        else:
            data = kwargs
        return data
965742
def render(self, name, value, attrs=None, renderer=None):
        
        context = self.get_context(name, value, attrs)
        return self._render(self.template_name, context, renderer)
1227955
def render_to_string(self, request, template, context, content_instance=None):
        
        if not content_instance:
            content_instance = PluginContext(request)

        content_instance.update(context)
        return render_to_string(template, content_instance.flatten(), request=request)
933695
def render_generator(self, context, result):
		
		context.response.encoding = 'utf8'
		context.response.app_iter = (
				(i.encode('utf8') if isinstance(i, unicode) else i)  # Stream encode unicode chunks.
				for i in result if i is not None  # Skip None values.
			)
		return True
599074
def render(self, url, template=None, expiration=0):
        
        template = template or self.default_template
        
        return render_to_string(template, self.get_context(url, expiration))
1182969
def render(self, data, accepted_media_type=None, renderer_context=None):
        
        self.accepted_media_type = accepted_media_type or ''
        self.renderer_context = renderer_context or {}

        template = loader.get_template(self.template)
        context = self.get_context(data, accepted_media_type, renderer_context)
        ret = template_render(template, context, request=renderer_context['request'])

        # Munge DELETE Response code to allow us to return content
        # (Do this *after* we've rendered the template so that we include
        # the normal deletion response code in the output)
        response = renderer_context['response']
        if response.status_code == status.HTTP_204_NO_CONTENT:
            response.status_code = status.HTTP_200_OK

        return ret
719231
def template_string(context, template):
    ''
    if not isinstance(context, Context):
        context = Context(context)
    return Template(template).render(context)
584944
function renderTemplate(template, context) {
			try {
				var func = _.template(template.template);
				return func(context);
			}
			catch (e) {
				grunt.fail.fatal('Error while rendering template ' + template.filename + ': ' + e.message);
			}
		}
335727
def render(self, context):
        
        with self.merge_translation(context):
            django_translated = self.do_translate.render(context)

        return django_translated
132602
def render(self, context):
        
        notifications = self.obj.resolve(context)
        return self.generate_html(notifications)
296479
def _get_content(self, context):
        
        self._valid_template()
        context.update({
            "csrf_token_value": get_token(self.request)
        })
        return render_to_string(self.get_template_names(), context)
1150592
def render_to_string(self, template_name, context=None):
        """"""
        # create an empty context if no context was specified
        context = context or {}
        tmpl = self.get_template(template_name)
        # render the template into a unicode string (None means unicode)
        return tmpl. \
            generate(**context). \
            render(self.output_type, encoding=None)