Render the options to an HTML string.
542118
function _render_option(){

	var buf = new Array();

	// Sort the items in the mdata array.
	// Also keep a lookup for a "special" entry.
	// var default_on_p = false;
	var mdata_keys = bbop.core.get_keys(anchor.mdata);
	function _data_comp(a, b){

	    // Get the associated data.
	    var a_data = anchor.mdata[a];
	    var b_data = anchor.mdata[b];

	    // if( (a_data['special'] == true && a_data['selected'] == true) ||
	    // 	(b_data['special'] == true && b_data['selected'] == true) ){
	    // 	default_on_p = true;
	    // }

	    //
	    var retval = 0;
	    if( a_data['special'] != b_data['special'] ){
		if( a_data['count'] == true ){
		    retval = 1;
		}else{
		    retval = -1;
		}
	    }else if( a_data['count'] != b_data['count'] ){
		if( a_data['count'] > b_data['count'] ){
		    retval = -1;
		}else{
		    retval = 1;
		}
	    }else if( a_data['label'] != b_data['label'] ){
		if( a_data['label'] > b_data['label'] ){
		    retval = 1;
		}else{
		    retval = -1;
		}
	    }

	    return retval;
	}
	mdata_keys.sort(_data_comp); // inplace sort

	//
	for( var mski = 0; mski < mdata_keys.length; mski++ ){

	    var write_data = anchor.mdata[mdata_keys[mski]];
	    
	    // Write out option if:
	    // 1) the default is selected (so we want to see everything)
	    // 2) the selection is special
	    // 3) if the default is not selected, either the item is selected or
	    // 4) it has a count (and is thus interesting)
	    if( // default_on_p == true ||
	    	write_data['selected'] == true ||
	    	write_data['special'] == true ||
	    	( write_data['count'] && write_data['count'] > 0 ) ){
		    
		    buf.push('<option');
		    // Title.
		    buf.push(' title="');
		    buf.push(write_data['value']);
		    buf.push('"');		
		    // Value.
		    buf.push(' value="');
		    buf.push(write_data['value']);
		    buf.push('"');		
		    if( write_data['selected'] ){
			buf.push(' selected="selected"');
		    }
		    buf.push('>');
		    //buf.push(bbop.core.crop(write_data['label']));
		    buf.push(bbop.core.crop(write_data['label'], 40, '...'));
		    
		    if( write_data['count'] && write_data['count'] > 0 ){
			buf.push(' (' + write_data['count'] + ')');
		    }
		    
		    buf.push('</option>');
		}
		
	}
	return buf.join('');
    }
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)
1036374
def render(self, name=None, value=None, attrs=None):
        
        attrs = {} or attrs
        self.attrs = attrs
        self.name = name
        self.value = value

        id_ = self.attrs.get('id')
        output = []
        for i, choice in enumerate(self.choices):
            choice_value, choice_label = choice
            if isinstance(choice_label, (tuple, list)):
                attrs_plus = self.attrs.copy()
                if id_:
                    attrs_plus['id'] += '_{}'.format(i)
                sub_ul_renderer = self.__class__(
                    attrs=attrs_plus,
                    choices=choice_label,
                )
                sub_ul_renderer.choice_input_class = self.choice_input_class
                output.append(html.format_html(
                    self.inner_html, choice_value=choice_value,
                    sub_widgets=sub_ul_renderer.render(),
                ))
            else:
                w = self.choice_input_class(
                    self.name, self.value, self.attrs.copy(), choice, i)
                output.append(html.format_html(
                    self.inner_html,
                    choice_value=force_text(w),
                    sub_widgets=''))
        return html.format_html(
            self.outer_html,
            id_attr=html.format_html(' id="{}"', id_) if id_ else '',
            content=mark_safe('\n'.join(output)),
        )
1109155
def render(context_scope = nil, locals = nil, &block)
      apply(context_scope, locals, &block) if context_scope || locals || block

      cache_results do
        send("to_#{@_options[:format]}")
      end
    end
59946
def render(self, context, request=None):
        """"""
        context['component'] = self
        return render_to_string(self.template_name, context, request)
430502
private static String toHtmlTable(final List<OptionWithMetaInfo> options) {
		StringBuilder htmlTable = new StringBuilder();
		htmlTable.append("<table class=\"table table-bordered\">\n");
		htmlTable.append("    <thead>\n");
		htmlTable.append("        <tr>\n");
		htmlTable.append("            <th class=\"text-left\" style=\"width: 20%\">Key</th>\n");
		htmlTable.append("            <th class=\"text-left\" style=\"width: 15%\">Default</th>\n");
		htmlTable.append("            <th class=\"text-left\" style=\"width: 65%\">Description</th>\n");
		htmlTable.append("        </tr>\n");
		htmlTable.append("    </thead>\n");
		htmlTable.append("    <tbody>\n");

		for (OptionWithMetaInfo option : options) {
			htmlTable.append(toHtmlString(option));
		}

		htmlTable.append("    </tbody>\n");
		htmlTable.append("</table>\n");

		return htmlTable.toString();
	}
817534
def render_to_string(self, template, context=None, def_name=None, subdir='templates'):
        ''''''
        template_adapter = self.get_template_loader(subdir).get_template(template)
        return getattr(template_adapter, 'render')(context=context, request=self.request, def_name=def_name)
185627
def render_js_code(self, id_, *args, **kwargs):
        """"""
        if id_:
            options = self.render_select2_options_code(
                    dict(self.get_options()), id_)
            return mark_safe(self.html.format(id=id_, options=options))
        return u''
968467
def render(self, form, form_style, context):
        
        return render_to_string(self.template, Context({'input': self}))
829386
private function render() {
		$strings = implode($this->strings);
		
		// Render includes
		foreach ($this->incTemplates as $path => $include) {
			$incOutput = $include->render();
			$path = preg_replace("/\//", "\/", $path);
			$strings = preg_replace("/\{include\s$path\}/", $incOutput, $strings);
		}
		
		// Render if-statements
		foreach ($this->ifTemplates as $key => $sub) {
			foreach ($sub as $iKey => $instance) {
				$str = '';
				
				if ($this->expressions[$key]->evaluate($this->vars)) {
					$str = $instance->render();
				}
				
				$pregKey = preg_quote($key, '/');
				$strings = preg_replace("/\{if:$pregKey:$iKey\}/", $str, $strings);
			}
		}
		
		// Render foreach-loops
		foreach ($this->forTemplates as $key => $sub) {
			foreach ($sub as $iKey => $instance) {
				$tmplGen = '';
				
				if (isset($this->vars[$key]) && is_array($this->vars[$key])) {
					foreach ($this->vars[$key] as $assocArray) {
						foreach ($assocArray as $k => $v)
							$instance->set($k, $v);
						$tmplGen .= $instance->render();
					}
				}
				
				$pregKey = preg_quote($key, '/');
				$strings = preg_replace("/\{for:$pregKey:$iKey\}/", $tmplGen, $strings);
			}
		}
		
		// Render plain old variables
		foreach ($this->vars as $key => $val) {
			if (!is_array($val))
				$strings = preg_replace("/\{$key\}/", $val, $strings);
		}
		
		// Render expressions
		foreach ($this->expressions as $key => $expr) {
			$eval = $expr->evaluate($this->vars);

			// If we're an array, lets insert the number of items in the array.
			if ( is_array( $eval ) ) {
				$eval = count( $eval );
			}

			$pregKey = preg_quote($key, '/');
			
			$strings = preg_replace('/\{'.$pregKey.'\}/', $eval, $strings);
		}
		
		$strings = preg_replace("/\\\{/", '{', $strings);
		$strings = preg_replace("/\\\}/", '}', $strings);

		return $strings;
	}
1142047
function render(engine, str, locals, engineOptions) {
  try {
    var output = engine.render(engine.engine, str, locals, engineOptions)
  } catch(e) {
    throw new Error(
      NAME + ': there was a problem rendering the template:\n' + e)
  }
  return output
}
113632
def render(self):
        """"""
        return Markup(env.get_template('form.html').render(form=self,
                                                           render_open_tag=True,
                                                           render_close_tag=True,
                                                           render_before=True,
                                                           render_sections=True,
                                                           render_after=True,
                                                           generate_csrf_token=None if self.disable_csrf else _csrf_generation_function))
294474
private function _optionsHTML()
    {
        $result = '';
        foreach ($this->options() as $key => $label) {
            $selected = ResourceTable::getSearchValue($this->index()) == $key ? ' selected="selected"' : '';
            $result .= '<option value="'.$key.'"'.$selected.'>'.$label.'</option>';
        }
        return $result;
    }
1094236
def render_bash_options(self):
        """"""
        options = ''
        if self.config.debug:
            options += "set -x\n"
        if self.config.strict:
            options += "set -euo pipefail\n"
        return options
313619
def render_html_attributes(**kwargs):
    """"""
    attr = list()
    if kwargs:
        attr = ['{}="{}"'.format(key, val) for key, val in kwargs.items()]
    return " ".join(attr).replace("css_class", "class")
821095
def options_for_render(options = {})
      style = options_for_style(options[:style] || DEFAULT_OPTIONS[:style])
      DEFAULT_OPTIONS.merge(style).merge(options)
    end
1329070
public function render($options = array())
    {
        $string = $options['string'];
        $data = $options['data'];

        return $this->renderTpl($string, $data);
    }