Build the choices for "list" and "checkbox" parameters
@returns {Object} - collection of lists of choices for "list" and "checkbox" parameters
511947
function getChoices() {
    const choicesLists = {
      // Build the list of available specification versions for input verification and interactive selection
      specVersion: [
        { value: 'doc', name: icli.format.info('doc') + ' - version of the specification for documentation purpose (Swagger UI, Postman ...)' },
        { value: 'api-gateway', name: icli.format.info('aws') + ' - version of the specification used for publication in API Gateway' },
        { value: 'complete', name: icli.format.info('complete') + ' - version of the specification containing everything (doc + aws)' }
      ]
    };

    // Build lists of resource paths and http methods
    choicesLists.resourcePath = () => {
      return plugin.loadEndpoints()
      .then(endpoints => {
        if (!endpoints.length) {
          icli.print(icli.format.error('This project does not contain any endpoint.'));
          process.exit(1);
        }
        const resourcePaths = [];
        _.forEach(endpoints, endpoint => {
          if (_.findIndex(resourcePaths, rp => { return rp.value === endpoint.getResourcePath(); }) === -1) {
            const spec = endpoint.getSpec();
            resourcePaths.push({
              value: endpoint.getResourcePath(),
              name: endpoint.getResourcePath() + (spec.summary ? ' - ' + spec.summary : '')
            });
          }
        });
        return resourcePaths;
      });
    };

    choicesLists.httpMethod = function(answers, cmdParameterValues) {
      // @FIXME comquirer is not able to validate a list for a question, using the command parameter values
      if (answers) {
        const resourcePath = answers.resourcePath || cmdParameterValues.resourcePath;
        return plugin.loadEndpoints()
        .then(endpoints => {
          const httpMethods = [];
          _.forEach(endpoints, endpoint => {
            if (endpoint.getResourcePath() === resourcePath) {
              httpMethods.push(endpoint.getMethod());
            }
          });
          return httpMethods;
        });
      }
      // @FIXME so we list all possible methods
      return _.concat(plugin.httpMethods, _.map(plugin.httpMethods, String.toLowerCase));
    };

    return choicesLists;
  }
1099495
def get_all_choices(cls, *args, **kwargs):
        
        plugins = cls.get_plugins(*args, **kwargs)
        all_choices = reduce(operator.add, [
            plugin.choices for plugin in plugins
        ])
        choices = []
        seen = set()
        for template, label in all_choices:
            # De-duplicate.
            if template in seen:
                continue
            seen.add(template)
            # Validate.
            try:
                validators.template_name(template)
            except ValidationError:
                continue
            choices.append((template, label))
        # Sort by label.
        choices = sorted(choices, key=lambda a: (a[0], a[1]))
        return choices
943334
def multiple_choice(name, choices = [], options = {})
      field name, MultipleChoiceField.new(choices, options)
    end
561237
function checkboxValues(selection) {
  return selection.select('.body')
     .selectAll('input:checked').data().map(d => d.id);
}
14388
public String buildOptions() {

        StringBuffer result = new StringBuffer(128);

        result.append("<input type='checkbox' name='");
        result.append(PARAM_READTREE);
        result.append("' value='true' onclick=\"reloadReport();\"");
        if (Boolean.valueOf(getParamReadtree()).booleanValue()) {
            result.append(" checked='checked'");
        }
        result.append(">&nbsp;");
        result.append(key(Messages.GUI_DELETED_RESOURCES_READ_TREE_0));

        return result.toString();
    }
1169164
function(values) {
      Object.keys(values).forEach(function(name) {
        this.find("[name='" + name + "']").each(function() {
          if (this.is("textarea")) {
            this.text(values[name]);
          } else if (this.is("select")) {
            this.find("option[value='" + values[name] + "']")
              .attr("selected","selected");
          } else {
            this.attr("value",values[name]);
          }
        });
      }.bind(this));
      return this;
    }
999613
function getChoices() {
  const name = choice => fp.padStart(MAX_DESC)(choice.value)
  const desc = choice => wrap(choice.description, MAX)
  return types.map(choice => {
    if (choice.value === 'separator') return SEPARATOR
    return {
      name: `${name(choice)}  ${choice.emoji}  ${desc(choice)}`,
      value: choice.value,
      short: name(choice)
    }
  })
}
543143
def gen_checkbox_list(sig_dic):
    '''
    
    '''
    view_zuoxiang = '''<span class="iga_pd_val">'''

    dic_tmp = sig_dic['dic']
    for key in dic_tmp.keys():
        tmp_str = '''{{% if "{0}" in postinfo.extinfo["{1}"] %}} {2}  {{% end %}}
        '''.format(key, sig_dic['en'], dic_tmp[key])
        view_zuoxiang += tmp_str

    view_zuoxiang += '''</span>'''
    return view_zuoxiang
1250137
def _choices(self):
        
        # Generate key/value strings
        pairs = []
        for key, value in self.choices.items():
            pairs.append(str(value) + "=" + str(key))

        # Assemble into overall string and escape
        return GPTaskSpec.manifest_escape(";".join(pairs))
43427
def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {})
      bootstrap = form_bootstrap.scoped(options.delete(:bootstrap))
      return super if bootstrap.disabled

      content = "".html_safe
      unless options[:include_hidden] == false
        content << hidden_field(method, multiple: true, value: "")
      end

      args = [bootstrap, :check_box, method, collection, value_method, text_method, options, html_options]
      content << draw_choices(*args) do |m, v, opts|
        opts[:multiple]       = true
        opts[:include_hidden] = false
        ActionView::Helpers::FormBuilder.instance_method(:check_box).bind(self).call(m, opts, v)
      end
    end
920631
function getCheckedList() {
    const checked = [];
    this.state.items.forEach((item, i) => {
        if (item.checked) {
            checked.push(i);
        }
    });
    return checked;
}
395604
def choices(self):
        
        if isinstance(self._choices, Promise):
            self._choices = list(self._choices)
        return self._choices
758908
function () {
			
			var i, j, ilength, jlength, currentSubChoices, currentSubChoice, currentValue,
			    testValue, isDuplicateChoice, secondSelectChoices;
			
			
			// object used in updateSecondSelectChoices
			//
			//   * key   : string representing a value in 1st select
			//   * value : array of values available in 2nd select when key is selected in first select
			//
			this.valuesMatching = {};
			
			
			// helper to filter 2nd select choices to find duplicates
			isDuplicateChoice = function(elt, arrElt) {
				elt    = lang.isObject(elt)    ? elt.value    : elt;
				arrElt = lang.isObject(arrElt) ? arrElt.value : arrElt;
				return elt === arrElt;
			};
			
			// collect 2nd level choices + ensure uniqueness of values
			secondSelectChoices = [];
			
			for (i = 0, ilength = this.options.choices.length; i < ilength; i += 1) {
				
				currentValue = lang.isObject(this.options.choices[i]) ? this.options.choices[i].value : this.options.choices[i];
				currentSubChoices = this.options.choices[i].choices;
				
				this.valuesMatching[currentValue] = [];
				
				// maybe no sub choices ???
				if (currentSubChoices) {
					for (j = 0, jlength = currentSubChoices.length; j < jlength; j += 1) {
					
						currentSubChoice = currentSubChoices[j];
					
						testValue = lang.isObject(currentSubChoice) ? currentSubChoice.value : currentSubChoice;
					
						this.valuesMatching[currentValue].push(testValue);
					
						if (inputEx.indexOf(testValue, secondSelectChoices, isDuplicateChoice) === -1) {
							secondSelectChoices.push(currentSubChoices[j]);
						}
					
					}
				}
				
			}
			
			
			// create and store selects
			this.selects = [];
			this.selects.push(new inputEx.SelectField({ choices: this.options.choices }));
			this.selects.push(new inputEx.SelectField({ choices: secondSelectChoices }));
			
			// append <select>s to DOM tree
			this.fieldContainer.appendChild(this.selects[0].getEl());
			this.fieldContainer.appendChild(this.selects[1].getEl());
			
		}
974088
function(checkbox, options) {
        this.element = checkbox = $(checkbox);
        options = this.setOptions(options, checkbox);
        this.wrapper = this._buildWrapper();

        // Create custom input
        this.input = this.render(options.checkboxTemplate)
            .attr('for', checkbox.attr('id'))
            .insertAfter(checkbox);

        // Initialize events
        this.initialize();
    }
617179
def rejectionOptionsList(self):
        ""
        plone = getSite()
        settings = plone.bika_setup
        # RejectionReasons will return something like:
        # [{'checkbox': u'on', 'textfield-2': u'b', 'textfield-1': u'c', 'textfield-0': u'a'}]
        if len(settings.RejectionReasons) > 0:
            reject_reasons = settings.RejectionReasons[0]
        else:
            return []
        sorted_keys = sorted(reject_reasons.keys())
        if 'checkbox' in sorted_keys:
            sorted_keys.remove('checkbox')
        # Building the list with the values only because the keys are not needed any more
        items = []
        for key in sorted_keys:
            items.append(reject_reasons[key].strip())
        return items
250667
function () {
		
			var choiceIndex;
			
			if (this.el.selectedIndex >= 0) {
				
				choiceIndex = inputEx.indexOf(this.el.childNodes[this.el.selectedIndex], this.choicesList, function (node, choice) {
					return node === choice.node;
				});
			
				return this.choicesList[choiceIndex].value;
				
			} else {
				
				return "";
				
			}
		}
16676
function() {
    var allOptions = this.dropdown.options,
        i=0, j=allOptions.length;

    // Look for multi-select selections
    if(lang.isArray(this.value)) {
        var allValues = this.value,
            m=0, n=allValues.length,
            hash = {};
        // Reset all selections and stash options in a value hash
        for(; i<j; i++) {
            allOptions[i].selected = false;
            hash[allOptions[i].value] = allOptions[i];
        }
        for(; m<n; m++) {
            if(hash[allValues[m]]) {
                hash[allValues[m]].selected = true;
            }
        }
    }
    // Only need to look for a single selection
    else {
        for(; i<j; i++) {
            if(this.value === allOptions[i].value) {
                allOptions[i].selected = true;
            }
        }
    }
}