render the supplied block for the specified function
334460
function function_ (options) {
  options.hash.kind = 'function'
  var result = ddata._identifier(options)
  return result ? options.fn(result) : 'ERROR, Cannot find function.'
}
779068
def render(self, result, mimetype, errors=None):
        
        available_mimetypes = [x for x in self.render_map.keys() if '/' in x]
        render_func = None

        if '/' not in mimetype:
            # naked superformat (does not correspond to a mimetype)
            render_func = self.reject_map.get(mimetype, None)
            if not render_func:
                raise NoViewMethod("Unknown Superformat: %s" % mimetype)

        if not render_func and available_mimetypes:
            target_mimetype = mimeparse.best_match(available_mimetypes, mimetype)
            render_func = self.render_map.get(target_mimetype, None)

        if not render_func:
            raise NoViewMethod("%s not supported for this program" % mimetype)

        principle_mimetype = render_func.mimetypes[0]

        if GiottoControl in render_func.__class__.mro():
            # redirection defined as view (not wrapped in lambda)
            return {'body': render_func, 'persist': render_func.persist}

        if callable(self.persist):
            # persist (cookie data) can be either an object, or a callable)
            persist = self.persist(result)
        else:
            persist = self.persist

        # render functins can take either one or two arguments, both are
        # supported by the API
        arg_names = inspect.getargspec(render_func).args
        num_args = len(set(arg_names) - set(['self', 'cls']))
        if num_args == 2:
            data = render_func(result, errors or Mock())
        else:
            # if the renderer only has one argument, don't pass in the 2nd arg.
            data = render_func(result)

        if GiottoControl in data.__class__.mro():
            # render function returned a control object
            return {'body': data, 'persist': persist}

        if not hasattr(data, 'items'):
            # view returned string
            data = {'body': data, 'mimetype': principle_mimetype}
        else:
            # result is a dict in for form {body: XX, mimetype: xx}
            if not 'mimetype' in data and target_mimetype == '*/*':
                data['mimetype'] = ''

            if not 'mimetype' in data:
                data['mimetype'] = target_mimetype

        data['persist'] = persist
        return data
759242
def render(*args, &block)
      captured = helpers.capture do
        helpers.concat(helpers.render(*args, &block))
        helpers.output_buffer.to_s
      end
      rawtext(captured)
    end
1246094
def _render(self, data, formula_def):
        '''
        
        '''
        # FORMULA can contain a renderer option
        renderer = formula_def.get('renderer', self.opts.get('renderer', 'jinja|yaml'))
        rend = salt.loader.render(self.opts, {})
        blacklist = self.opts.get('renderer_blacklist')
        whitelist = self.opts.get('renderer_whitelist')
        template_vars = formula_def.copy()
        template_vars['opts'] = self.opts.copy()
        return compile_template(
            ':string:',
            rend,
            renderer,
            blacklist,
            whitelist,
            input_data=data,
            **template_vars
        )
296114
function customRenderFn(renderFn) {
  // The loader context.
  var _this = this

  return function (engine, template, locals, options) {
    return renderFn.call(_this, template, locals, options)
  }
}
1017655
function compileRender(templateSource, data, block) {
  const hash = md5(templateSource);

  return Promise.try(() => {
    const cached = compileRenderCache.get(hash);
    if (cached) {
      compileRenderCache.ttl(hash);
      return cached;
    }

    const templateFunction = precompile(templateSource, {})
      .then(code => evaluate(code));

    compileRenderCache.set(hash, templateFunction);
    return templateFunction;
  }).then((templateFunction) => {
    if (block) {
      templateFunction = templateFunction.blocks && templateFunction.blocks[block];
    }
    if (!templateFunction) {
      return '';
    }

    return runtime(Benchpress.helpers, data, templateFunction);
  }).catch((err) => {
    err.message = `Render failed for template ${templateSource.slice(0, 20)}:\n ${err.message}`;
    err.stack = `Render failed for template ${templateSource.slice(0, 20)}:\n ${err.stack}`;

    throw err;
  });
}
478233
function _render() {
			var HTML = '<ol>';
			var barInfoHTML = '<ol>';

			//get all data from the filter ui elements
			var filterOptions = _getFilterOptions();
			//filtered and modified data
			var data = _applyFilters(_rawdata, filterOptions);

			//no data bar
			if (data.length === 0) {
				HTML += '<li class="line nodata" data-uid="' + -1 + '"></li>';
				barInfoHTML += '<li class="line nodata" data-uid="' + -1 + '"><div class="info line">No data</div></li>';
			}

			data.forEach(function (item) {
				var rawItem = _getBarById(item.uid);
				HTML += '<li data-uid="' + item.uid + '" class="line" title="' + _getBarTitle(rawItem) + '"' + _getBarDataAttributes(rawItem) + '  >';
				HTML += '<div class="bar ' + _getBarColor(rawItem.duration) + '" style="width: ' + _calculateBarWidth(item.duration) + ' margin-left: ' + _calculateBarOffset(item, filterOptions.filterByTime.start) + '">';
				HTML += '<div class="sub-bar ' + _getBarColor(rawItem.time) + '" style="width: ' + _calculateBarWidth(item.time) + '"></div>';
				HTML += '</div>';
				HTML += '</li>';

				//render bar info ==================================================================================
				barInfoHTML += '<li data-uid="' + item.uid + '" title="' + _getBarTitle(rawItem) + '" class="line ' + _getBarClassType(rawItem.categories[0]) + '" ' + _getBarDataAttributes(rawItem) + '>';
				barInfoHTML += '<div class="info line">' + _formatInfo(rawItem) + ' (' + (rawItem.time).toFixed(0) + ' ms)</div>';
				barInfoHTML += '</li>';
			});

			HTML += '</ol>';
			barInfoHTML += '</ol>';

			document.querySelector('#sapUiSupportPerfHeaderTimelineBarWrapper').innerHTML = HTML;
			document.querySelector('#sapUiSupportPerfHeaderTimelineBarInfoWrapper').innerHTML = barInfoHTML;

			_createTimelineGrid(filterOptions);
			_filterByCategory(); // Don't change the order, this is applying css styles on the rendered content
		}
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)
995746
def render(scope, locals, &block)
      @locals, @scope = locals, scope
      set_locals_variables
      
      instance_eval(@source) if @source.present?
      instance_eval(&block) if block_given?
      
      super
    end
445701
private void renderRenderable(IAnimatedRenderable renderable)
	{
		this.renderable = renderable;
		set(renderable.getWorld(), renderable.getPos());
		posOffset = new Vec3d(pos.getX(), pos.getY(), pos.getZ());

		renderable.renderAnimated(block, this);
	}
116678
def _render_template_block_nodelist(nodelist, block_name, context):
    """"""

    # Attempt to find the wanted block in the current template.
    for node in nodelist:
        # If the wanted block was found, return it.
        if isinstance(node, BlockNode):
            # No matter what, add this block to the rendering context.
            context.render_context[BLOCK_CONTEXT_KEY].push(node.name, node)

            # If the name matches, you're all set and we found the block!
            if node.name == block_name:
                return node.render(context)

        # If a node has children, recurse into them. Based on
        # django.template.base.Node.get_nodes_by_type.
        for attr in node.child_nodelists:
            try:
                new_nodelist = getattr(node, attr)
            except AttributeError:
                continue

            # Try to find the block recursively.
            try:
                return _render_template_block_nodelist(new_nodelist, block_name, context)
            except BlockNotFound:
                continue

    # The wanted block_name was not found.
    raise BlockNotFound("block with name '%s' does not exist" % block_name)
454182
def render(*args, &block)
      options = _normalize_render(*args, &block)
      rendered_body = render_to_body(options)
      if options[:html]
        _set_html_content_type
      else
        _set_rendered_content_type rendered_format
      end
      self.response_body = rendered_body
    end
416378
def render_blocks(self, template_name, **context):
        
        blocks = {}
        template = self._get_template(template_name)
        for block in template.blocks:
            blocks[block] = self._render_context(template,
                                                template.blocks[block],
                                                **context)
        return blocks
1055687
def render(self, get_params, module, _if=None):
        
        enough = False
        output = []
        valid = None

        if self.commands.show:
            valid = True
        if self.parent and self.commands.soft and _if is None:
            return None, self
        if _if:
            valid = True
        elif self.commands._if:
            valid = self.check_valid(get_params)
        if valid is not False:
            for item in self.content:
                if isinstance(item, Placeholder):
                    sub_valid, sub_output, enough = item.get(get_params, self)
                    output.append(sub_output)
                elif isinstance(item, Literal):
                    sub_valid = None
                    enough = True
                    output.append(item.text)
                elif isinstance(item, Block):
                    sub_valid, sub_output = item.render(get_params, module)
                    if sub_valid is None:
                        output.append(sub_output)
                    else:
                        output.extend(sub_output)
                valid = valid or sub_valid
        if not valid:
            if self.next_block:
                valid, output = self.next_block.render(
                    get_params, module, _if=self.commands._if
                )
            elif self.parent is None and (
                (not self.next_block and enough) or self.base_block
            ):
                valid = True
            else:
                output = []

        # clean
        color = self.commands.color
        if color and color[0] != "#":
            color_name = "color_%s" % color
            threshold_color_name = "color_threshold_%s" % color
            # substitute color
            color = (
                getattr(module, color_name, None)
                or getattr(module, threshold_color_name, None)
                or getattr(module.py3, color_name.upper(), None)
            )
            if color == "hidden":
                return False, []

        text = u""
        out = []
        if isinstance(output, str):
            output = [output]

        # merge as much output as we can.
        # we need to convert values to unicode for concatination.
        if python2:
            conversion = unicode  # noqa
            convertables = (str, bool, int, float, unicode)  # noqa
        else:
            conversion = str
            convertables = (str, bool, int, float, bytes)

        first = True
        last_block = None
        for index, item in enumerate(output):
            is_block = isinstance(item, Block)
            if not is_block and item:
                last_block = None
            if isinstance(item, convertables) or item is None:
                text += conversion(item)
                continue
            elif text:
                if not first and (text == "" or out and out[-1].get("color") == color):
                    out[-1]["full_text"] += text
                else:
                    part = {"full_text": text}
                    if color:
                        part["color"] = color
                    out.append(part)
                text = u""
            if isinstance(item, Composite):
                if color:
                    item.composite_update(item, {"color": color}, soft=True)
                out.extend(item.get_content())
            elif is_block:
                # if this is a block then likely it is soft.
                if not out:
                    continue
                for x in range(index + 1, len(output)):
                    if output[x] and not isinstance(output[x], Block):
                        valid, _output = item.render(get_params, module, _if=True)
                        if _output and _output != last_block:
                            last_block = _output
                            out.extend(_output)
                        break
            else:
                if item:
                    out.append(item)
            first = False

        # add any left over text
        if text:
            part = {"full_text": text}
            if color:
                part["color"] = color
            out.append(part)

        # process any min/max length commands
        max_length = self.commands.max_length
        min_length = self.commands.min_length

        if max_length or min_length:
            for item in out:
                if max_length is not None:
                    item["full_text"] = item["full_text"][:max_length]
                    max_length -= len(item["full_text"])
                if min_length:
                    min_length -= len(item["full_text"])
            if min_length > 0:
                out[0]["full_text"] = u" " * min_length + out[0]["full_text"]
                min_length = 0

        return valid, out
260722
def render(self,scope=None,local_vars=None,block=None):
		''' 
		'''

		if not scope:
			class Scope(object):
				pass

			scope = Scope()

		return self.evaluate(scope,local_vars or {}, block)
463105
def _render(template, render, renderer, template_dict, opts):
    '''
    
    '''
    if render:
        if template_dict is None:
            template_dict = {}
        if not renderer:
            renderer = opts.get('renderer', 'jinja|yaml')
        rend = salt.loader.render(opts, {})
        blacklist = opts.get('renderer_blacklist')
        whitelist = opts.get('renderer_whitelist')
        ret = compile_template(template, rend, renderer, blacklist, whitelist, **template_dict)
        if salt.utils.stringio.is_readable(ret):
            ret = ret.read()
        if six.text_type(ret).startswith('#!') and not six.text_type(ret).startswith('#!/'):
            ret = six.text_type(ret).split('\n', 1)[1]
        return ret
    with salt.utils.files.fopen(template, 'r') as fh_:
        return fh_.read()
627382
def render_it(self, *args, **kwargs):
        '''
        
        '''
        kind = kwargs.get('kind', args[0])
        num = kwargs.get('num', args[1] if len(args) > 1 else 6)
        with_tag = kwargs.get('with_tag', False)
        glyph = kwargs.get('glyph', '')

        all_cats = MPost.query_most(kind=kind, num=num).objects()
        kwd = {
            'with_tag': with_tag,
            'router': router_post[kind],
            'glyph': glyph
        }
        return self.render_string('modules/info/list_equation.html',
                                  recs=all_cats,
                                  kwd=kwd)