Function that renders and appends the option taking into account type and possible image icon.
497772
function(select, option, type) {
        // Add disabled attr if disabled
        var disabledClass = (option.is(':disabled')) ? 'disabled ' : '';
        var optgroupClass = (type === 'optgroup-option') ? 'optgroup-option ' : '';
        var multipleCheckbox = multiple ? '<input type="checkbox"' + disabledClass + '/><label></label>' : '';

        // 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.
          options.append($('<li class="' + disabledClass + optgroupClass + '"><img alt="" src="' + icon_url + '"' + classString + '><span>' + multipleCheckbox + option.html() + '</span></li>'));
          return true;
        }

        // Check for multiple type.
        options.append($('<li class="' + disabledClass + optgroupClass + '"><span>' + multipleCheckbox + option.html() + '</span></li>'));
      }
1361707
def add(self, option):
				
		if option.__class__ == Option:
			for _option in self.options:
				if option.name == _option.name:
					raise OptionDuplicateError(_option.name)
			self.options.append(option)
		else:
			raise TypeError("invalid type supplied")
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('"', "'"))
104513
def fill_options options
      {
        :pretty => true,
        :format => Rxhp::HTML_FORMAT,
        :skip_doctype => false,
        :doctype => Rxhp::HTML_5,
        :depth => 0,
        :indent => 2,
      }.merge(options)
    end
1089016
function buildOptions(i) {
        var index = (i + 1);
        var isCurrent = i === current;

        // Options for each text, arrow and image, using the base options and the index
        var text = extend({}, optionsText, {paths: '#jelly-text-' + index + ' path'});
        var arrow = extend({}, optionsArrow, {paths: '#jelly-arrow-' + index});
        var image = extend({}, isCurrent ? optionsImage : optionsCircle, {image: 'img/image-' + index + '.jpg'});

        // If not the current item, set circle in the position defined, hide text, and hide arrow
        if (!isCurrent) {
            extend(image, circlePositions[i]);
            extend(text, {hidden: true});
            extend(arrow, {hidden: true});
        }

        // Push all of these to the options array
        options.push(text);
        options.push(arrow);
        options.push(image);
    }
359390
async function generate(options = {}) {
  options = Object.assign(DEFAULT_OPTIONS, options)

  // Log start
  let msg = `Generating font kit from ${ options.paths.length } SVG icons`.yellow
  log(options, msg)

  // Run validation over options
  await validateOptions(options)

  if (options.codepoints) {
    options.codepointsMap = await getCodepointsMap(options.codepoints)
  }

  // Run font generation
  const config = getGeneratorConfig(options)
  const generatorResult = await fontGenerator(config)

  // Clean up after generator
  await deleteUnspecifiedTypes(options)

  // If specified, generate JSON map
  if (options.json) {
    await generateJson(options, generatorResult)
  }

  // Log generated files
  logReport(options)
}
98072
def render_diff_value(value, type, action, options = {})
      return "".html_safe if value.blank?

      value_to_render = case type
                        when :date
                          l value, format: :long
                        when :percentage
                          number_to_percentage value, precision: 2
                        else
                          value
                        end

      content_tag(:div, class: "card--list__item #{action}") do
        content_tag(:div, class: "card--list__text") do
          content_tag(:div, { class: "diff__value" }.merge(options)) do
            value_to_render
          end
        end
      end
    end
1033341
function Images(el, options) {
        this.el = el;
        this.$el = $(el);
        this.$currentImage = null;
        this.templates = window.MediumInsert.Templates;
        this.core = this.$el.data('plugin_' + pluginName);

        this.options = $.extend(true, {}, defaults, options);

        this._defaults = defaults;
        this._name = pluginName;

        // Allow image preview only in browsers, that support's that
        if (this.options.preview && !window.FileReader) {
            this.options.preview = false;
        }

        // Extend editor's functions
        if (this.core.getEditor()) {
            this.core.getEditor()._serializePreImages = this.core.getEditor().serialize;
            this.core.getEditor().serialize = this.editorSerialize;
        }

        this.init();
    }
264874
function makeOptionsHot(id, options) {
  if (options.functional) {
    const render = options.render
    options.render = (h, ctx) => {
      const instances = map[id].instances
      if (ctx && instances.indexOf(ctx.parent) < 0) {
        instances.push(ctx.parent)
      }
      return render(h, ctx)
    }
  } else {
    injectHook(options, initHookName, function() {
      const record = map[id]
      if (!record.Ctor) {
        record.Ctor = this.constructor
      }
      record.instances.push(this)
    })
    injectHook(options, 'beforeDestroy', function() {
      const instances = map[id].instances
      instances.splice(instances.indexOf(this), 1)
    })
  }
}
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'

}
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)
576308
def handle_option(self, opt):
        """"""
        self.options.append(opt)
        log.debug('options: %s', self.options)
29935
def _insert_options(self, menu):
        """"""
        menu.append(Gtk.SeparatorMenuItem())
        menu.append(self._menuitem(
            _('Mount disc image'),
            self._icons.get_icon('losetup', Gtk.IconSize.MENU),
            run_bg(lambda _: self._losetup())
        ))
        menu.append(Gtk.SeparatorMenuItem())
        menu.append(self._menuitem(
            _("Enable automounting"),
            icon=None,
            onclick=lambda _: self._daemon.automounter.toggle_on(),
            checked=self._daemon.automounter.is_on(),
        ))
        menu.append(self._menuitem(
            _("Enable notifications"),
            icon=None,
            onclick=lambda _: self._daemon.notify.toggle(),
            checked=self._daemon.notify.active,
        ))
        # append menu item for closing the application
        if self._quit_action:
            menu.append(Gtk.SeparatorMenuItem())
            menu.append(self._menuitem(
                _('Quit'),
                self._icons.get_icon('quit', Gtk.IconSize.MENU),
                lambda _: self._quit_action()
            ))
1195315
private void appendOptionalArgString(StringBuilder sb, JSType paramType, boolean forAnnotations) {
    if (paramType.isUnionType()) {
      // Remove the optionality from the var arg.
      paramType =
          paramType
              .toMaybeUnionType()
              .getRestrictedUnion(registry.getNativeType(JSTypeNative.VOID_TYPE));
    }
    paramType.appendAsNonNull(sb, forAnnotations).append("=");
  }
1172356
def append(self, option):
        
        self._options.append(self._parse_option(option))
        self._refresh_options()
        self.resize(self._width, self._height)
1166250
function (option) {
      var $parent = option.appendTo;
      if (!($parent instanceof $)) { $parent = $($parent); }
      var $el = $('<ul></ul>')
        .addClass(option.dropdownClassName)
        .attr('id', 'textcomplete-dropdown-' + option._oid)
        .css({
          display: 'none',
          left: 0,
          position: 'absolute',
          zIndex: option.zIndex
        })
        .appendTo($parent);
      return $el;
    }
756993
function diffImage(existing, proposed, options) {
  let { bytes, dateformat, imageSize, Table, toFile, colors } = utils;

  existing = toFile(existing, options);
  proposed = toFile(proposed, options);

  let table = new Table({ head: ['Attribute', 'Existing', 'Replacement', 'Diff'] });
  let dimensionsA = imageSize(existing.path);
  let dimensionsB = imageSize(proposed.path);
  let statA = existing.stat;
  let statB = proposed.stat;

  let isSmaller = existing.size > proposed.size;
  let sizeDiff = isSmaller ? '-' : '+';
  sizeDiff += bytes(Math.abs(existing.size - proposed.size));

  // dates
  let mtimeA = statA ? dateformat(statA.mtime) : 'New';
  let mtimeB = statB ? dateformat(statB.mtime) : 'New';
  if (statA.mtime && statB.mtime && statA.mtime < statB.mtime) {
    mtimeB = colors.green(mtimeB);
  } else {
    mtimeA = colors.green(mtimeA);
  }

  let birthtimeA = statA ? dateformat(statA.birthtime) : 'New';
  let birthtimeB = statB ? dateformat(statB.birthtime) : 'New';
  if (statA.birthtime && statB.birthtime && statA.birthtime < statB.birthtime) {
    birthtimeB = colors.green(birthtimeB);
  } else {
    birthtimeA = colors.green(birthtimeA);
  }

  // size
  let sizeA = bytes(existing.size);
  let sizeB = bytes(proposed.size);

  if (isSmaller) {
    sizeDiff = colors.red(sizeDiff);
    dimensionsA = colors.green(dimensionsA);
    sizeA = colors.green(sizeA);
  } else {
    sizeDiff = colors.green(sizeDiff);
    dimensionsB = colors.green(dimensionsB);
    sizeB = colors.green(sizeB);
  }

  table.push(['Path', existing.relative, proposed.relative, '']);
  table.push(['Size', sizeA, sizeB, sizeDiff]);
  table.push(['Dimensions', dimensionsA, dimensionsB, 'N/A']);
  table.push(['Date created', birthtimeA, birthtimeB, 'N/A']);
  table.push(['Date modified', mtimeA, mtimeB, 'N/A']);
  return table.toString();
}