Renders the provided template, with a reduced set of variables from the provided
parameters list. Variables included are only those which can be safely printed.
491848
public function renderStringTemplate(string $string, array $parameters = []): string
    {
        try {
            $parameters = iterator_to_array($this->getTemplateVariables($parameters));

            $environment = new Environment(new ArrayLoader());
            $template = $environment->createTemplate($string);

            return $environment->resolveTemplate($template)->render($parameters);
        } catch (Throwable $t) {
            return '';
        }
    }
475269
def render_all(self, op, exclude=[], opt=None):
        
        opt = self.default() if opt == None else opt
        if not isinstance(op, Operation):
            raise ValueError('Not a Operation: {0}'.format(op))
        if not isinstance(opt, dict):
            raise ValueError('Not a dict: {0}'.format(opt))

        template = opt['parameter_template']
        max_p = opt['max_parameter']
        out = {}
        for p in op.parameters:
            if p.name in exclude:
                continue
            if p.name in template:
                out.update({p.name: template[p.name]})
                continue
            if not max_p and not p.required:
                if random.randint(0, 1) == 0 or opt['minimal_parameter']:
                    continue
            out.update({p.name: self.render(p, opt=opt)})
        return out
580960
protected function render()
    {
        $presenter = $this->createPresenter($this->getRequiredTemplateVariable('Presenter'));

        try {
            $arguments = $this->getArguments($presenter);
            $result = call_user_func_array($presenter, $arguments);
        } catch(\Exception $e) {
            if ($this->throwRenderExceptions) {
                throw $e;
            }

            $this->Logger->error($e->getMessage() .
                    "\n\nURL: " . \URLUtils::fullUrl() .
                    "\n\nTemplate Vars:\n" . print_r($this->templateVars, true) .
                    (isset($arguments) ? "\n\n$presenter args:\n" . print_r($arguments, true) : '')
                );

            $result = '';
        }

        $this->setTemplateVariable('PRESENTER_RESULT', $result);

        // just return something so the template engine thinks
        // something happened.
        return array(array());
    }
1123004
def render_template(template_file, template_vars):
    """"""
    # Load our Jinja templates
    template_dir = "{0}/templates".format(
        os.path.dirname(os.path.abspath(__file__))
    )
    jinja_env = jinja2.Environment(
        loader=jinja2.FileSystemLoader(template_dir),
        trim_blocks=True
    )
    rendered = jinja_env.get_template(template_file).render(template_vars)

    return rendered
949594
def render_page(page, page_args):
    
    print(page_args)
    template_name = page.template if page.template else page.name
    template = "signage/pages/{}.html".format(template_name)
    if page.function:
        context_method = getattr(pages, page.function)
    else:
        context_method = getattr(pages, page.name)
    sign, request = page_args
    context = context_method(page, sign, request)
    return render_to_string(template, context)
1032881
def render(self):
		
		self.widget.attrs = {
			k: v for k, v in self.attrs.items() if k[0] != "_"
		}
		self.set_input()

		if not self.attrs.get("_no_wrapper"):
			self.set_label()
			self.set_help()
			self.set_errors()
			self.set_classes()
			self.set_icon()  # Must be the bottom-most setter

		self.values["class"] = pad(" ".join(self.values["class"])).lstrip()
		result = mark_safe(FIELD_WRAPPER % self.values)
		self.widget.attrs = self.attrs  # Re-assign variables
		return result
753263
def render_view(parser, token):
    
    bits = token.split_contents()

    n = len(bits)
    if n < 2:
        raise TemplateSyntaxError("'%s' takes at least one view as argument")

    viewname = bits[1]

    kwargs = {}
    if n > 2:
        for bit in bits[2:]:
            match = kwarg_re.match(bit)
            if not match:
                raise TemplateSyntaxError("Malformed arguments to render_view tag")
            name, value = match.groups()
            if name:
                kwargs[name] = parser.compile_filter(value)

    return StringNode(viewname, kwargs)
18979
public function renderView()
    {
        if ($this->form) {
            $this->template->trySet('name', $this->short_name);
        }

        parent::renderView();
    }
1280105
def render(template, **kwargs):
    
    import jinja2
    import os.path as path

    searchpath = path.join(path.dirname(__file__), 
        "templates") 
    loader = jinja2.FileSystemLoader(searchpath=searchpath)
    env = jinja2.Environment(loader=loader)
    temp = env.get_template(template)

    return temp.render(**kwargs)
143360
public function render()
	{
		extract($this->_vars);

		$path = APP_PATH
		        . Agl::APP_TEMPLATE_DIR
		        . static::APP_HTTP_DIR
		        . DS
		        . $this->_file;

		require($path);
	}
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)
1109007
protected RawData __render(String template) {
        if (null == template) return new RawData("");
        return S.raw(__engine.sandbox().render(template, __renderArgs));
    }
1103283
def prepare(self, context):
        
        self.params = {}

        # no params, not even a newline
        if not self.nodelist:
            return

        # just static text, no vars, assume one TextNode
        if not self.nodelist.contains_nontext:
            text = self.nodelist[0].s.strip()

        # vars in params, we have to render
        else:
            context.push()
            context['object'] = self.obj
            text = self.nodelist.render(context)
            context.pop()

        if text:
            self.params = self.resolve_params(text)

        # override the default template from the parameters
        if 'template_name' in self.params:
            self.template_name = self.params['template_name']
1031499
def render(view_options=configuration)
      logger.debug "rendering"
      result = ""
      if template
        logger.debug "rendering with template : #{template}"
        view = AppView.new(items, view_options)
        view.template = template
        result = view.render
      else
        items.each_with_index do |item, index|
          result += "\n" unless index == 0
          result += item.name.green + ":\n"
          if item.respond_to?(:attributes)
            attributes = item.attributes.deep_clone
            result += attributes.recursively_stringify_keys!.to_conf.gsub(/\s+$/, '') # strip trailing whitespace from YAML
            result += "\n"
          end
        end
      end
      result
    end
945178
def render(self, context):
        """"""

        content = mark_safe(self.get_content_from_context(context))
        if not content:
            return ''
        if self.parsed:
            try:
                t = template.Template(content, name=self.name)
                content = mark_safe(t.render(context))
            except TemplateSyntaxError as error:
                if global_settings.DEBUG:
                    content = PLACEHOLDER_ERROR % {
                        'name': self.name,
                        'error': error,
                    }
                else:
                    content = ''
        if self.as_varname is None:
            return content
        context[self.as_varname] = content
        return ''
87332
public Renderable<?> render(Template template, Map<String, Object> parameters) {
        return template.render(this, parameters);
    }
771143
def print_variables(self):
        
        print_out = partial(self.print_out, format_options='green')

        print_out('===== variables =====')

        for var, hint in self.vars.get_descriptions().items():
            print_out('    %' + var + ' = ' + var + ' = ' + hint.replace('%', '%%'))

        print_out('=====================')

        return self