Function that renders and appends the option taking into account type and possible image icon.
484751
function(select, option, type) {
        // Add disabled attr if disabled
        var disabledClass = (option.is(':disabled')) ? 'disabled ' : '';

        // add icons
        var icon_url = option.data('icon');
        var classes = option.attr('class');
        if (!!icon_url) {
          var classString = '';
          if (!!classes) classString = ' class="' + classes + '"';

          // Check for multiple type.
          if (type === 'multiple') {
            options.append($('<li class="' + disabledClass + '"><img src="' + icon_url + '"' + classString + '><span><input type="checkbox"' + disabledClass + '/><label></label>' + option.html() + '</span></li>'));
          } else {
            options.append($('<li class="' + disabledClass + '"><img src="' + icon_url + '"' + classString + '><span>' + option.html() + '</span></li>'));
          }
          return true;
        }

        // Check for multiple type.
        if (type === 'multiple') {
          options.append($('<li class="' + disabledClass + '"><span><input type="checkbox"' + disabledClass + '/><label></label>' + option.html() + '</span></li>'));
        } else {
          options.append($('<li class="' + disabledClass + '"><span>' + option.html() + '</span></li>'));
        }
      }
1255979
def before_render(self):
        
        # Render the Add button if the user has the AddClient permission
        if check_permission(AddClient, self.context):
            self.context_actions[_("Add")] = {
                "url": "createObject?type_name=Client",
                "icon": "++resource++bika.lims.images/add.png"
            }

        # Display a checkbox next to each client in the list if the user has
        # rights for ModifyPortalContent
        self.show_select_column = check_permission(ModifyPortalContent,
                                                   self.context)
1031337
function Renderer(options) {
  var defaults = {
    headers: {
      included: true,
      downcase: true,
      upcase: true
    },

    delimiter: 'tab',
    decimalSign: 'comma',
    outputDataType: 'json',
    columnDelimiter: "\t",
    rowDelimiter: '\n',

    inputHeader: {},
    outputHeader: {},
    dataSelect: {},

    outputText: '',

    newline: '\n',
    indent: '  ',

    commentLine: '//',
    commentLineEnd: '',
    tableName: 'converter',

    useUnderscores: true,
    includeWhiteSpace: true,
    useTabsForIndent: false
  };

  this.options = merge({}, defaults, options);
  if (this.options.includeWhiteSpace) {
    this.options.newline = '\n';
  } else {
    this.options.indent = '';
    this.options.newline = '';
  }
}
864945
private int renderOptions(StringBuilder sb, Collection<Option> options) {
        String lpad = OptionUtils.createPadding(getLeftPad());
        String dpad = OptionUtils.createPadding(getDescPad());

        // first create list containing only <lpad>-a,--aaa where 
        // -a is opt and --aaa is long opt; in parallel look for 
        // the longest opt string this list will be then used to 
        // sort options ascending
        int leftWidth = 0;
        List<StringBuilder> lineBufList = new ArrayList<>();
        Collection<Option> optList = options;
        if (optList.size() > 1 && getOptionComparator() != null) {
            List<Option> optList2 = new ArrayList<>(optList);
            optList2.sort(getOptionComparator());
            optList = optList2;
        }
        for (Option option : optList) {
            StringBuilder lineBuf = new StringBuilder();
            if (option.getName() == null) {
                lineBuf.append(lpad).append(LONG_OPTION_PREFIX).append(option.getLongName());
            } else {
                lineBuf.append(lpad).append(OPTION_PREFIX).append(option.getName());
                if (option.hasLongName()) {
                    lineBuf.append(", ").append(LONG_OPTION_PREFIX).append(option.getLongName());
                }
            }
            if (option.hasValue()) {
                String argName = option.getValueName();
                if (argName != null && argName.isEmpty()) {
                    // if the option has a blank arg name
                    lineBuf.append(' ');
                } else {
                    lineBuf.append(option.isWithEqualSign() ? '=' : LONG_OPTION_SEPARATOR);
                    lineBuf.append(ARG_BRACKET_OPEN).append(argName != null ? argName : getArgName()).append(ARG_BRACKET_CLOSE);
                }
            }
            lineBufList.add(lineBuf);
            leftWidth = (lineBuf.length() > leftWidth ? lineBuf.length() : leftWidth);
        }

        if (leftWidth > getMaxLeftWidth()) {
            leftWidth = getMaxLeftWidth();
        }

        int x = 0;
        for (Iterator<Option> it = optList.iterator(); it.hasNext();) {
            Option option = it.next();
            StringBuilder lineBuf = lineBufList.get(x++);
            if (lineBuf.length() <= leftWidth) {
                if (lineBuf.length() < leftWidth) {
                    lineBuf.append(OptionUtils.createPadding(leftWidth - lineBuf.length()));
                }
                lineBuf.append(dpad);
                if (option.getDescription() != null) {
                    lineBuf.append(option.getDescription());
                }
                renderWrappedText(sb, getWidth(), leftWidth + getDescPad(), lineBuf.toString());
            } else {
                sb.append(lineBuf).append(NEW_LINE);
                if (option.getDescription() != null) {
                    String line = OptionUtils.createPadding(leftWidth + getDescPad()) + option.getDescription();
                    renderWrappedText(sb, getWidth(), leftWidth + getDescPad(), line);
                }
            }
            if (it.hasNext()) {
                sb.append(NEW_LINE);
            }
        }
        return leftWidth;
    }
604989
function(options) {
        this.originHTML = this.$main.html();

        this.$main.addClass([defaultClass, options.customClass, prefix + options.theme].join(' '));

        if (options.size === 'large') {
            this.$main.addClass(largeClass);
        }

        if (options.text) {
            this.$main.html(options.text);
        }

        if (options.icon) {
            var iconName = !document.documentMode ? options.icon : window.bizui.codepoints[options.icon];
            this.$main.prepend('<i class="biz-icon">' + iconName + '</i> ');
        }

        if (options.disabled) {
            this.disable();
        }
    }
349358
function augment(el) {
  // FIXME should always have a type
  el.type = el.type || 'category';
  el.icon = (typesIcons[el.type] || typesIcons.default).icon;
  el.data = { value: el.text, type: el.type };
  // branch
  if (el.children && el.children.length > 0) {
    el.state = { opened: el.children.length > 50 ? false : true };
    el.children.forEach(function(c) {
      c = augment(c);
    });
    el.text = el.text + ' [' + el.children.length + ']';
  // value or category
  } else if (el.size && el.size > 0) {
    if (curAnnos.indexOf(el.text) > -1) {
      el.state = { selected: true };
    }
    el.text = el.text + ' (' + el.size + ')';
  }
  return el;

}
1030108
function renderChoices(choices, pointer) {
  var output = '';
  var separatorOffset = 0;

  choices.forEach(function(choice, i) {
    if (choice.type === 'separator') {
      separatorOffset++;
      output += ' ' + choice + '\n';
      return;
    }

    if (choice.disabled) {
      separatorOffset++;
      output += ' - ' + choice.name;
      output += ' (' + (typeof choice.disabled === 'string' ? choice.disabled : 'Disabled') + ')';
    } else {
      var isSelected = (i - separatorOffset === pointer);
      output += isSelected ? utils.chalk.cyan(utils.figures.pointer) : ' ';
      output += getCheckbox(choice.checked) + ' ' + choice.name;
    }

    output += '\n';
  });

  return output.replace(/\n$/, '');
}
1342771
def render_iconchoicefield(field, attrs):
	
	choices = ""

	# Loop over every choice to manipulate
	for choice in field.field._choices:
		value = choice[1].split("|")  # Value|Icon

		# Each choice is formatted with the choice value being split with
		# the "|" as the delimeter. First element is the value, the second
		# is the icon to be used.
		choices += format_html(
			wrappers.ICON_CHOICE_TEMPLATE,
			choice[0],  # Key
			mark_safe(wrappers.ICON_TEMPLATE.format(value[-1])),  # Icon
			value[0]  # Value
		)

	# Render a dropdown field
	return render_choicefield(field, attrs, choices)
1329491
function PygmentizeOptions (options) {
  if(!(this instanceof PygmentizeOptions))
    return new PygmentizeOptions(options);

  if(options.lexer && validate.lexer.test(options.lexer))
    this.lexer = options.lexer;

  if(options.guess && !this.lexer)
    this.guess = true;

  if(options.formatter && validate.formatter.test(options.formatter))
    this.formatter = options.formatter;
  else
    this.formatter = 'html'

}
879903
function(options) {
        var params = [],
            opts = options || {},
            transform = 'contrast';

        if (opts.sharpen) {
            params.push('sharpen=' + opts.sharpen);
        }

        if (params.length) {
            transform += ':' + params.join(',');
        }

        return this.append(transform);
    }
902966
def render_button(
    content,
    button_type=None,
    icon=None,
    button_class="btn-default",
    size="",
    href="",
    name=None,
    value=None,
    title=None,
    extra_classes="",
    id="",
):
    
    attrs = {}
    classes = add_css_class("btn", button_class)
    size = text_value(size).lower().strip()
    if size == "xs":
        classes = add_css_class(classes, "btn-xs")
    elif size == "sm" or size == "small":
        classes = add_css_class(classes, "btn-sm")
    elif size == "lg" or size == "large":
        classes = add_css_class(classes, "btn-lg")
    elif size == "md" or size == "medium":
        pass
    elif size:
        raise BootstrapError(
            'Parameter "size" should be "xs", "sm", "lg" or '
            + 'empty ("{}" given).'.format(size)
        )
    if button_type:
        if button_type not in ("submit", "reset", "button", "link"):
            raise BootstrapError(
                'Parameter "button_type" should be "submit", "reset", '
                + '"button", "link" or empty  ("{}" given).'.format(button_type)
            )
        attrs["type"] = button_type
    classes = add_css_class(classes, extra_classes)
    attrs["class"] = classes
    icon_content = render_icon(icon) if icon else ""
    if href:
        attrs["href"] = href
        tag = "a"
    else:
        tag = "button"
    if id:
        attrs["id"] = id
    if name:
        attrs["name"] = name
    if value:
        attrs["value"] = value
    if title:
        attrs["title"] = title
    return render_tag(
        tag,
        attrs=attrs,
        content=mark_safe(text_concat(icon_content, content, separator=" ")),
    )
615471
function addOption( combo, optionText, optionValue, documentObject, index )
	{
		combo = getSelect( combo );
		var oOption;
		if ( documentObject )
			oOption = documentObject.createElement( "OPTION" );
		else
			oOption = document.createElement( "OPTION" );

		if ( combo && oOption && oOption.getName() == 'option' )
		{
			if ( CKEDITOR.env.ie ) {
				if ( !isNaN( parseInt( index, 10) ) )
					combo.$.options.add( oOption.$, index );
				else
					combo.$.options.add( oOption.$ );

				oOption.$.innerHTML = optionText.length > 0 ? optionText : '';
				oOption.$.value     = optionValue;
			}
			else
			{
				if ( index !== null && index < combo.getChildCount() )
					combo.getChild( index < 0 ? 0 : index ).insertBeforeMe( oOption );
				else
					combo.append( oOption );

				oOption.setText( optionText.length > 0 ? optionText : '' );
				oOption.setValue( optionValue );
			}
		}
		else
			return false;

		return oOption;
	}
1224813
function option(csh, type, value) {
    var errno = capstone.cs_option(csh, type, value);
    if (errno) {
        throw "cs_option returned " + errno + ": " + exports.strerror(errno);
    }
}
1302500
function icons (opts, ctx, done) {
    return vfs.src(opts.input)
        .pipe(easysvg.stream({js: false}))
        .on('error', done)
        .pipe(vfs.dest(opts.output))
}
744673
function () {
        var self = this, id = self._id, prefix = self.classPrefix;
        var icon = self.state.get('icon'), image, text = self.state.get('text'), textHtml = '';

        image = self.settings.image;
        if (image) {
          icon = 'none';

          // Support for [high dpi, low dpi] image sources
          if (typeof image != "string") {
            image = window.getSelection ? image[0] : image[1];
          }

          image = ' style="background-image: url(\'' + image + '\')"';
        } else {
          image = '';
        }

        if (text) {
          self.classes.add('btn-has-text');
          textHtml = '<span class="' + prefix + 'txt">' + self.encode(text) + '</span>';
        }

        icon = icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';

        return (
          '<div id="' + id + '" class="' + self.classes + '" tabindex="-1" aria-labelledby="' + id + '">' +
          '<button role="presentation" type="button" tabindex="-1">' +
          (icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
          textHtml +
          '</button>' +
          '</div>'
        );
      }
995879
function() {
			//merge initial options
			_opt = merge(_def, opt);
			_opt.bgColor = hexToRgb(_opt.bgColor);
			_opt.textColor = hexToRgb(_opt.textColor);
			_opt.position = _opt.position.toLowerCase();
			_opt.animation = (animation.types['' + _opt.animation]) ? _opt.animation : _def.animation;

			var isUp = _opt.position.indexOf('up') > -1;
			var isLeft = _opt.position.indexOf('left') > -1;

			//transform animation
			if (isUp || isLeft) {
				for (var i = 0; i < animation.types['' + _opt.animation].length; i++) {
					var step = animation.types['' + _opt.animation][i];

					if (isUp) {
						if (step.y < 0.6) {
							step.y = step.y - 0.4;
						} else {
							step.y = step.y - 2 * step.y + (1 - step.w);
						}
					}

					if (isLeft) {
						if (step.x < 0.6) {
							step.x = step.x - 0.4;
						} else {
							step.x = step.x - 2 * step.x + (1 - step.h);
						}
					}

					animation.types['' + _opt.animation][i] = step;
				}
			}
			_opt.type = (type['' + _opt.type]) ? _opt.type : _def.type;
			try {
				_orig = link.getIcon();
				//create temp canvas
				_canvas = document.createElement('canvas');
				//create temp image
				_img = document.createElement('img');
				if (_orig.hasAttribute('href')) {
					_img.setAttribute('src', _orig.getAttribute('href'));
					//get width/height
					_img.onload = function() {
						_h = (_img.height > 0) ? _img.height : 32;
						_w = (_img.width > 0) ? _img.width : 32;
						_canvas.height = _h;
						_canvas.width = _w;
						_context = _canvas.getContext('2d');
						icon.ready();
					};
				} else {
					_img.setAttribute('src', '');
					_h = 32;
					_w = 32;
					_img.height = _h;
					_img.width = _w;
					_canvas.height = _h;
					_canvas.width = _w;
					_context = _canvas.getContext('2d');
					icon.ready();
				}
			} catch(e) {
				throw 'Error initializing favico. Message: ' + e.message;
			}

		}
634548
def render(self,
               data,
               chart_type,
               chart_package='corechart',
               options=None,
               div_id="chart",
               head=""):
        """"""
        if not self.is_valid_name(div_id):
            raise ValueError(
                "Name {} is invalid. Only letters, numbers, '_', and '-' are permitted ".format(
                    div_id))

        return Template(head + self.template).render(
            div_id=div_id.replace(" ", "_"),
            data=json.dumps(
                data, indent=4).replace("'", "\\'").replace('"', "'"),
            chart_type=chart_type,
            chart_package=chart_package,
            options=json.dumps(
                options, indent=4).replace("'", "\\'").replace('"', "'"))