adheres to the list of given choices for the param in the options (if any are defined)
7637
private void checkChoices(Option o, Map<String, String> data) throws RequiredParametersException {
		if (o.getChoices().size() > 0 && !o.getChoices().contains(data.get(o.getName()))) {
			throw new RequiredParametersException("Value " + data.get(o.getName()) +
					" is not in the list of valid choices for key " + o.getName());
		}
	}
434662
def valid_value(self, value):
        
        if isinstance(value, Constant):
            value = value.name
        text_value = force_text(value)
        for option_value, option_label, option_title in self.choices:
            if value == option_value or text_value == force_text(option_value):
                return True
        return False
911277
def []=(key, val)
      supported_option?(key) || raise(UnsupportedOptionError, key.inspect)
      values[key] = val
    end
541809
def options(self, value):
        
        if value is None:
            value = []
        assert isinstance(value, list)
        self._options = value
420858
def _create_and_add_parameters(params):
    '''
    
    '''
    global _current_parameter
    if _is_simple_type(params):
        _current_parameter = SimpleParameter(params)
        _current_option.add_parameter(_current_parameter)
    else:
        # must be a list
        for i in params:
            if _is_simple_type(i):
                _current_parameter = SimpleParameter(i)
            else:
                _current_parameter = TypedParameter()
                _parse_typed_parameter(i)
            _current_option.add_parameter(_current_parameter)
87010
def choices(self, changelist):
        
        show_all = self.used_parameters.get(self.parameter_name) == "1"
        return (
            {
                'display': _('Current Configuration'),
                'selected': not show_all,
                'query_string': changelist.get_query_string({}, [self.parameter_name]),
            },
            {
                'display': _('All (Show History)'),
                'selected': show_all,
                'query_string': changelist.get_query_string({self.parameter_name: "1"}, []),
            }
        )
1327315
public static void checkRequired(OptionSet options, List<String> opts)
            throws VoldemortException {
        List<String> optCopy = Lists.newArrayList();
        for(String opt: opts) {
            if(options.has(opt)) {
                optCopy.add(opt);
            }
        }
        if(optCopy.size() < 1) {
            System.err.println("Please specify one of the following options:");
            for(String opt: opts) {
                System.err.println("--" + opt);
            }
            Utils.croak("Missing required option.");
        }
        if(optCopy.size() > 1) {
            System.err.println("Conflicting options:");
            for(String opt: optCopy) {
                System.err.println("--" + opt);
            }
            Utils.croak("Conflicting options detected.");
        }
    }
359838
def options(self, glob=False, **args):
        
        kwargs = {}
        for argname, argarg in args.items():
            if argname == "sort":
                argarg = self._getPattern(argarg)
            if argname not in ["done", "undone"]:
                kwargs[argname] = argarg
        if "done" in args or "undone" in args:
            kwargs["done"] = self._getDone(
                args.get("done"), args.get("undone")
            )

        self.model.setOptions(glob=glob, **kwargs)
258566
def options
      options = {}
      VALID_OPTION_KEYS.each{|k| options[k] = send(k)}
      options
    end
373654
def params_values(self):
        
        return [p.value for p in atleast_list(self.params) if p.has_value]
1348422
function () {
			
			var i, length;
			
			for (i = 0, length = this.choicesList.length; i < length; i += 1) {
				this.enableChoice(this.choicesList[i]);
			}
			
		}
1213308
def _verify_params(self):
        
        reserved_in_use = self._RESERVED_PARAMS.intersection(self.extra_params)
        if reserved_in_use:
            raise ValueError("Using a reserved parameter", reserved_in_use)
273761
public static void checkOptional(OptionSet options, List<String> opts)
            throws VoldemortException {
        List<String> optCopy = Lists.newArrayList();
        for(String opt: opts) {
            if(options.has(opt)) {
                optCopy.add(opt);
            }
        }
        if(optCopy.size() > 1) {
            System.err.println("Conflicting options:");
            for(String opt: optCopy) {
                System.err.println("--" + opt);
            }
            throw new VoldemortException("Conflicting options detected.");
        }
    }
1069155
function checkOptions(options) {
                // @TODO: should we throw an error if there are incorrect options provided?
                options = _.pick(options, permittedOptions);

                let validationErrors = utils.validateOptions(options);

                if (_.isEmpty(validationErrors)) {
                    return Promise.resolve(options);
                }

                // For now, we can only handle showing the first validation error
                return Promise.reject(validationErrors[0]);
            }
1164411
def DEFINE_list(self, name, default, help, constant=False):
    """"""
    self.AddOption(
        type_info.List(
            name=name,
            default=default,
            description=help,
            validator=type_info.String()),
        constant=constant)
633426
def _is_valid_options_weights_list(value):
    ''''''
    return ((isinstance(value, list)) and
            len(value) > 1 and
            (all(isinstance(opt, tuple) and
                 len(opt) == 2 and
                 isinstance(opt[1], (int, float))
                 for opt in value)))
108169
void allowedOptions(String... opts) {
        for (String opt : opts) {
            options.putIfAbsent(opt, false);
        }
    }