render a template from a skin template file...
331624
public static function insertTemplatePF ($parser, $template, $spot=''){
    //process additional arguments into a usable array
    $params = array();
    //sanitize the template name
    $template = preg_replace('/[^A-Za-z0-9_\-]/', '_', $template);
    //this will be stripped out, assuming the skin is based on Skinny.template
    return '<p>ADDTEMPLATE('.$spot.'):'.$template.':ETALPMETDDA</p>';
  }
1159898
def render(file):
    """"""
    fp = file.open()
    content = fp.read()
    fp.close()

    notebook = nbformat.reads(content.decode('utf-8'), as_version=4)

    html_exporter = HTMLExporter()
    html_exporter.template_file = 'basic'
    (body, resources) = html_exporter.from_notebook_node(notebook)
    return body, resources
670912
function template (file, locals) {
	let fullpath = resolve('views', file);
	const [engine, target] = ex2engine(fullpath);
	if (engine !== 'html') {
		return render[engine](target, Object.assign({}, locals, {
			liveReloadHost: process.env.liveReloadHost,
			isDevelopment: configuration.env !== 'production'
		}));
	} else {
		return new Promise(function (resolve, reject) {
			try {
				fs.accessSync(target, fs.constants.R_OK);
				resolve(fs.readFileSync(target, 'utf-8'));
			} catch (err) {
				/* istanbul ignore next */
				reject(err);
			}
		});
	}
}
1125808
def render_template(self, template, **kwargs):
        
        kwargs["base_template"] = self.appbuilder.base_template
        kwargs["appbuilder"] = self.appbuilder
        return render_template(
            template, **dict(list(kwargs.items()) + list(self.extra_args.items()))
        )
906611
def render_to_string(template_name, context=None, request=None, using=None):
    
    if isinstance(template_name, (list, tuple)):
        template = select_template(template_name, using=using)
    else:
        template = get_template(template_name, using=using)
    return template.render(context, request)
685018
def render_template(template_name, context):
    """"""
    return Environment(
        loader=PackageLoader('remarkable')
    ).get_template(template_name).render(context)
745940
def render(self, **kwargs):
        """"""
        return self._template.render(this=self, kwargs=kwargs)
1073903
def render(template, saltenv='base', sls='', tmplpath=None, **kws):
    '''
    
    '''
    template = tmplpath
    if not os.path.isfile(template):
        raise SaltRenderError('Template {0} is not a file!'.format(template))

    tmp_data = salt.utils.templates.py(
            template,
            True,
            __salt__=__salt__,
            salt=__salt__,
            __grains__=__grains__,
            grains=__grains__,
            __opts__=__opts__,
            opts=__opts__,
            __pillar__=__pillar__,
            pillar=__pillar__,
            __env__=saltenv,
            saltenv=saltenv,
            __sls__=sls,
            sls=sls,
            **kws)
    if not tmp_data.get('result', False):
        raise SaltRenderError(tmp_data.get('data',
            'Unknown render error in py renderer'))

    return tmp_data['data']
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
959813
function renderTemplate(templatePath, viewOpts, callback) {
  templateContent(templatePath, function(err, content) {
    if (err) {
      return callback(err, null);
    } else {
      return callback(null, Mustache.to_html(content, viewOpts));
    }
  });
}
206713
def render_template_file(file_name, context):
    
    with open(file_name, 'r+') as f:
        template = Template(f.read())
        output = template.render(context)
        f.seek(0)
        f.write(output)
        f.truncate()
273619
function render_with_layout(template, locals, cb) {
    render_file(locals, function(err, str) {
      if (err) {
        return cb(err);
      }

      locals.body = str;

      var res = template(locals, handlebarsOpts);
      self.async.done(function(values) {
        Object.keys(values).forEach(function(id) {
          res = res.replace(id, values[id]);
        });

        cb(null, res);
      });
    });
  }
503255
def render_string(template_string, context, format = default_format)
      render_file(proc_template(template_string), context, format)
    end
1175733
def render_template(process, template_string, context):
    """"""
    from resolwe.flow.managers import manager

    # Get the appropriate expression engine. If none is defined, do not evaluate
    # any expressions.
    expression_engine = process.requirements.get('expression-engine', None)
    if not expression_engine:
        return template_string

    return manager.get_expression_engine(expression_engine).evaluate_block(template_string, context)
1200499
def render(template, extra={}, **kwargs):
    """"""
    context = hookenv.execution_environment()
    context.update(extra)
    context.update(kwargs)
    return template.format(**context)
1285218
def render(filename, obj):
    """"""
    template_path = abspath(filename)
    env = jinja_env(template_path)
    template_base = os.path.basename(template_path)
    try:
        parsed_content = env.parse(env
                                   .loader
                                   .get_source(env, template_base))
        template_vars = meta.find_undeclared_variables(parsed_content)
        if template_vars:
            missing_vars(template_vars, parsed_content, obj)

        LOG.debug("rendering %s with %s vars",
                  template_path, len(template_vars))
        return env \
            .get_template(template_base) \
            .render(**obj)
    except jinja2.exceptions.TemplateSyntaxError as exception:
        template_trace = traceback.format_tb(sys.exc_info()[2])
        # Different error context depending on whether it is the
        # pre-render variable scan or not
        if exception.filename:
            template_line = template_trace[len(template_trace) - 1]
            raise aomi_excep.Validation("Bad template %s %s" %
                                        (template_line,
                                         str(exception)))

        template_str = ''
        if isinstance(exception.source, tuple):
            # PyLint seems confused about whether or not this is a tuple
            # pylint: disable=locally-disabled, unsubscriptable-object
            template_str = "Embedded Template\n%s" % exception.source[0]

        raise aomi_excep.Validation("Bad template %s" % str(exception),
                                    source=template_str)

    except jinja2.exceptions.UndefinedError as exception:
        template_traces = [x.strip()
                           for x in traceback.format_tb(sys.exc_info()[2])
                           if 'template code' in x]
        raise aomi_excep.Validation("Missing template variable %s" %
                                    ' '.join(template_traces))
59946
def render(self, context, request=None):
        """"""
        context['component'] = self
        return render_to_string(self.template_name, context, request)