Arguments:

          render_func: a function that accepts a RenderEngine and ContextStack
            instance and returns a template rendering as a unicode string.
339157
def _render_final(self, render_func, *context, **kwargs):
        
        stack = ContextStack.create(*context, **kwargs)
        self._context = stack

        engine = self._make_render_engine()

        return render_func(engine, stack)
1094882
def custom_render_template(template_name_or_list, **context):
    
    response_str = render_template(
        functools.reduce(lambda x, y: x + [os.path.join('custom', y), y],
                         to_list(template_name_or_list), []),
        **context
    )
    if hasattr(g, 'status_code'):
        status_code = g.status_code
    else:
        status_code = 200
    return response_str, status_code
958393
def render(self, context):
    ''''''
    modules = {
    }
    context['false'] = False
    context['true'] = True
    new_ctx = eval('dict(%s)'%self.code,modules,context)
    context.update(new_ctx)
    return ''
766921
def render_template(template_name, context, format='png',
                    output=None, using=None, **options):
    
    # output stream, as required by casperjs_capture
    stream = BytesIO()
    out_f = None
    # the suffix=.html is a hack for phantomjs which *will*
    # complain about not being able to open source file
    # unless it has a 'html' extension.
    with NamedTemporaryFile(suffix='.html') as render_file:
        template_content = render_to_string(
            template_name,
            context,
            using=using,
        )
        # now, we need to replace all occurences of STATIC_URL
        # with the corresponding file://STATIC_ROOT, but only
        # if STATIC_URL doesn't contain a public URI (like http(s))
        static_url = getattr(settings, 'STATIC_URL', '')
        if settings.STATIC_ROOT and\
           static_url and not static_url.startswith('http'):
            template_content = template_content.replace(
                static_url,
                'file://%s' % settings.STATIC_ROOT
            )
        render_file.write(template_content.encode('utf-8'))
        # this is so that the temporary file actually gets filled
        # with the result.
        render_file.seek(0)

        casperjs_capture(
            stream,
            url='file://%s' % render_file.name,
            **options
        )

        # if no output was provided, use NamedTemporaryFile
        # (so it is an actual file) and return it (so that
        # after function ends, it gets automatically removed)
        if not output:
            out_f = NamedTemporaryFile()
        else:
            # if output was provided, write the rendered
            # content to it
            out_f = open(output, 'wb')
        out_f.write(stream.getvalue())
        out_f.seek(0)

        # return the output if NamedTemporaryFile was used
        if not output:
            return out_f
        else:
            # otherwise, just close the file.
            out_f.close()
733983
def respond(template, context={}, request=None, **kwargs):
    ""
    from django.http import HttpResponse
    from django.template import RequestContext
    from django.template.loader import render_to_string    

    if request:
        default = context_processors.default(request)
        default.update(context)
    else:
        default = context.copy()
    
    rendered = render_to_string(template, default, context_instance=request and RequestContext(request) or None)
    return HttpResponse(rendered, **kwargs)
1319779
def call_template_str(self, template):
        '''
        
        '''
        high = compile_template_str(template,
                                    self.rend,
                                    self.opts['renderer'],
                                    self.opts['renderer_blacklist'],
                                    self.opts['renderer_whitelist'])
        if not high:
            return high
        high, errors = self.render_template(high, '<template-str>')
        if errors:
            return errors
        return self.call_high(high)
688833
def render(self, name=None, template=None, context={}):
        ''''

        '''

        if isinstance(template, Template):
            _template = template
        else:
            _template = Template.objects.get(name=name)

        # Maybe cache or save local ?
        response = self.env.from_string(
            _template.content).render(context)

        return response
919061
def render(self, template_name, **kw):
        '''
        
        '''
        logger.debug('Rendering template "%s"', template_name)
        vars = self.globs.copy()
        vars.update(kw)
        resolved_name, engine = self.resolve(template_name)
        return engine.render(resolved_name, **vars)
1018132
def render(self, context):
        
        try:
            args, ctx = self.get_resolved_arguments(context)
            target = args[0]
            if not target:
                return ''
            ctx['content'] = target
        except VariableDoesNotExist:
            return ''

        emitter = context.get('emitter')
        t_name = emitter.get_template_path(target)
        t = get_template(t_name)
        context.dicts.append(ctx)
        response = t.nodelist.render(context)
        context.pop()
        return response
62628
def render(template, context=None, **kwargs):
    
    renderer = Renderer()
    return renderer.render(template, context, **kwargs)
990539
def _render(self, template_name, context, renderer=None):
        """"""
        if renderer is None:
            renderer = get_default_renderer()
        return mark_safe(renderer.render(template_name, context))
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
290680
def context_processor(self, func: Callable, name: AppOrBlueprintKey=None) -> Callable:
        
        self.template_context_processors[name].append(ensure_coroutine(func))
        return func
314630
def render(request, template_name, context=None, content_type=None, status=None, using=None, logs=None):
    
    if logs:
        obj_logger = ObjectLogger()
        if not isinstance(logs, list):
            logs = [logs, ]
        for log in logs:
            log = obj_logger.log_response(
                log,
                context,
                status=str(status),
                headers='',
                content_type=str(content_type))
            log.save()
    return django_render(
        request,
        template_name,
        context=context,
        content_type=content_type,
        status=status,
        using=using)
863080
def render_template(template_in, file_out, context):
    
    renderer = pystache.Renderer()
    result = renderer.render_path(template_in, context)
    with open(file_out, 'w') as handle:
        LOGGER.info('Rendering: {} to {}'.format(template_in, file_out))
        handle.write(result)
    shutil.copymode(template_in, file_out)
1281625
def render_publ_template(template, **kwargs):
    
    text = render_template(
        template.filename,
        template=template,
        image=image_function(
            template=template,
            category=kwargs.get('category'),
            entry=kwargs.get('entry')),
        **kwargs
    )

    return text, caching.get_etag(text)
992204
def render_template(self, template, **kwargs):
        '''
        
        '''
        high = compile_template(template,
                                self.rend,
                                self.opts['renderer'],
                                self.opts['renderer_blacklist'],
                                self.opts['renderer_whitelist'],
                                **kwargs)
        if not high:
            return high
        return self.pad_funcs(high)