Returns renderer corresponding to a given value and rendering args.
501209
def GetRendererForValueOrClass(cls, value, limit_lists=-1):
    """"""

    if inspect.isclass(value):
      value_cls = value
    else:
      value_cls = value.__class__

    cache_key = "%s_%d" % (value_cls.__name__, limit_lists)
    try:
      renderer_cls = cls._renderers_cache[cache_key]
    except KeyError:
      candidates = []
      for candidate in itervalues(ApiValueRenderer.classes):
        if candidate.value_class:
          candidate_class = candidate.value_class
        else:
          continue

        if inspect.isclass(value):
          if issubclass(value_cls, candidate_class):
            candidates.append((candidate, candidate_class))
        else:
          if isinstance(value, candidate_class):
            candidates.append((candidate, candidate_class))

      if not candidates:
        raise RuntimeError(
            "No renderer found for value %s." % value.__class__.__name__)

      candidates = sorted(
          candidates, key=lambda candidate: len(candidate[1].mro()))
      renderer_cls = candidates[-1][0]
      cls._renderers_cache[cache_key] = renderer_cls

    return renderer_cls(limit_lists=limit_lists)
585654
def render_args(subparsers):
    """"""
    render_parser = subparsers.add_parser('render')
    render_parser.add_argument('directory',
                               help='Path where Secrefile and accoutrement'
                               ' will be rendered into')
    secretfile_args(render_parser)
    vars_args(render_parser)
    base_args(render_parser)
    thaw_from_args(render_parser)
99406
def render(self, target, data):
        """"""
        rows = self.get_rows(target, data)
        rows = self._filter_rows(rows)
        renderer = getattr(self, "_render_%s" % target.name, None)
        if renderer is None:
            raise ValueError(
                "Cannot render %r for %s." % (self.value, target))
        else:
            return renderer(rows)
376718
def _render(self, value, format):
        
        template = '<script>\ndocument.write(moment(\"{t}\").{f});\n</script>'
        return Markup(template.format(t=value, f=format))
1170486
def _render(item: ConfigItem, indent: str = "") -> str:
    
    optional = item.default_value != _NO_DEFAULT

    if is_configurable(item.annotation):
        rendered_annotation = f"{item.annotation} (configurable)"
    else:
        rendered_annotation = str(item.annotation)

    rendered_item = "".join([
            # rendered_comment,
            indent,
            "// " if optional else "",
            f'"{item.name}": ',
            rendered_annotation,
            f" (default: {item.default_value} )" if optional else "",
            f" // {item.comment}" if item.comment else "",
            "\n"
    ])

    return rendered_item
62628
def render(template, context=None, **kwargs):
    
    renderer = Renderer()
    return renderer.render(template, context, **kwargs)
884262
def price_value_renderer(value, currency=None, **options):
    """"""
    if not currency:
        currency = getattr(settings, 'CURRENCY', 'USD')
    return format_currency(value, currency, locale=utils.get_current_locale())
1239359
def render(content)
      content = content.symbolize_keys
      self.class.renderers.keys.each do |renderer_name|
        if content.key?(renderer_name)
          renderer = self.class.renderers[renderer_name]
          to_render = content.delete(renderer_name)
          rendered = renderer[:proc].call(to_render)

          # Unwrap a promise if we got one back
          if rendered.is_a?(Promise)
            rendered = rendered.sync
          end

          return [rendered, content.merge(content_type: renderer[:content_type])]
        end
      end

      # If we couldn't find a renderer - just render an empty string
      ["Error: render only supports #{self.class.renderers.keys.join(', ')}", content_type: 'text/plain']
    end
780996
private String renderArgument(Object argument)
    {
        if (argument == null)
        {
            return "null";
        }
        else if (argument instanceof String)
        {
            return "\"" + argument + "\"";
        }
        else if (argument instanceof Character)
        {
            return "\'" + argument + "\'";
        }
        else
        {
            return argument.toString();
        }
    }
979362
def render(self, db, safe_mode=False, extra_context=None):
        """"""
        return self.renderer.render(
            self.context,
            db,
            safe_mode=safe_mode,
            extra_context=extra_context
        )
1212158
function(value) {
	
	   // Render the subField
	   var subFieldEl = this.renderSubField(value);
	
		if(this.options.name) {
	   	subFieldEl.setFieldName(this.options.name+"["+this.subFields.length+"]");
		}
	
	   // Adds it to the local list
	   this.subFields.push(subFieldEl);
	   
	   return subFieldEl;
	}
76519
public StringBuffer render(StringBuffer buffer, Object... arguments)
    {

        return format(arguments, buffer, null);

    }
882316
def render(self, name, value, attrs=None):
        '''
        '''

        # expects a value in format YYYY-MM-DD or YYYY-MM or YYYY (or empty/None)
        year, month, day = 'YYYY', 'MM', 'DD'
        if value:
            # use the regular expression to pull out year, month, and day values
            # if regular expression does not match, inputs will be empty
            match = W3C_DATE_RE.match(value)
            if match:
                date_parts = match.groupdict()
                year = date_parts['year']
                month = date_parts['month']
                day = date_parts['day']


        year_html = self.create_textinput(name, self.year_field, year, size=4, title='4-digit year', onClick='javascript:if(this.value == "YYYY") { this.value = "" };')
        month_html = self.create_textinput(name, self.month_field, month, size=2, title='2-digit month', onClick='javascript:if(this.value == "MM") { this.value = "" };')
        day_html = self.create_textinput(name, self.day_field, day, size=2, title='2-digit day', onClick='javascript:if(this.value == "DD") { this.value = "" };')

        # display widget fields in YYYY-MM-DD order to match W3C date format,
        # and putting required field(s) on the left
        output = [year_html, month_html, day_html]

        return mark_safe(u' / \n'.join(output))
35111
def render(value):
    
    # Empty urls
    if not value:  # use case: wild card imports
        return r'^$'

    if value[0] != beginning:
        value = beginning + value

    if value[-1] != end:
        value += end

    return value
383483
def render_args(arglst, argdct):
    '''
    '''
    out = ''
    
    for arg in arglst:
        if arg.name in argdct:
            rendered = arg.render(argdct[arg.name])
            if rendered:
                out += ' '
                out += rendered

    return out
461215
function renderText(args, that) {
  if (isNewTextVersion) {
    args[0] = { ...args[0], children: pseudoText(args[0].children) };
    return defaultTextRender.apply(that, args);
  } else {
    const element = defaultTextRender.apply(that, args);
    return React.cloneElement(element, {
      children: pseudoText(element.props.children)
    });
  }
}
131376
def _render_value(self, val, context, delimiters=None):
        
        if not is_string(val):
            # In case the template is an integer, for example.
            val = self.to_str(val)
        if type(val) is not unicode:
            val = self.literal(val)
        return self.render(val, context, delimiters)