Validate the mutually exclusive options.

        Return `True` iff only zero or one of `BASE_ERROR_SELECTION_OPTIONS`
        was selected.
190562
def _validate_options(cls, options):
        
        for opt1, opt2 in \
                itertools.permutations(cls.BASE_ERROR_SELECTION_OPTIONS, 2):
            if getattr(options, opt1) and getattr(options, opt2):
                log.error('Cannot pass both {} and {}. They are '
                          'mutually exclusive.'.format(opt1, opt2))
                return False

        if options.convention and options.convention not in conventions:
            log.error("Illegal convention '{}'. Possible conventions: {}"
                      .format(options.convention,
                              ', '.join(conventions.keys())))
            return False
        return True
1179129
def _get_exclusive_error_codes(cls, options):
        """"""
        codes = set(ErrorRegistry.get_error_codes())
        checked_codes = None

        if options.ignore is not None:
            ignored = cls._expand_error_codes(options.ignore)
            checked_codes = codes - ignored
        elif options.select is not None:
            checked_codes = cls._expand_error_codes(options.select)
        elif options.convention is not None:
            checked_codes = getattr(conventions, options.convention)

        # To not override the conventions nor the options - copy them.
        return copy.deepcopy(checked_codes)
183240
def valid(self, value, level=[]):
		

		# Reset validation failures
		self.validation_failures = []

		# If the value is None and it's optional, we're good
		if value is None and self._optional:
			return True

		# Go through each of the nodes
		for i in range(len(self._nodes)):

			# If it's valid
			if self._nodes[i].valid(value):

				# Return OK
				return True

		# Not valid for anything
		self.validation_failures.append(('.'.join(level), 'no valid option'))
		return False
387304
def validation_error_message(cls, spec, backends=None):
        
        try:
            cls.validate_spec(spec, backends=backends)
        except OptionError as e:
            return e.format_options_error()
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
1108294
function isValidOptions(options) {
  if(!options) {
    return false;
  }

  if(options.hasOwnProperty('ids') && Array.isArray(options.ids)) {
    for(var cId = 0; cId < options.ids.length; cId++) {
      if(!reelib.identifier.isValid(options.ids[cId])) {
        return false;
      }
    }
    return true;
  }

  else {
    return false;
  }
}
1258390
def validate_options(self, k, v):
        """"""

        super().validate_options(k, v)
        if k == 'delimiters':
            for d in v:
                if not isinstance(d, (dict, OrderedDict)):
                    raise ValueError("{}: 'delimters' entries must be of dict type.".format(self.__class__.__name__))
                for key, value in d.items():
                    if key not in ('open', 'close', 'content'):
                        raise KeyError(
                            "{}: '{}' is not a valid key for a 'delimeters' entry.".format(self.__class__.__name__, key)
                        )
                    if not isinstance(value, str):
                        raise ValueError(
                            "{}: 'delimeters' '{}' key should have str values.".format(self.__class__.__name__, value)
                        )
820633
def _check_defaults(self, x_only=True):
		
		if self.x is None:
			self.err(self._check_defaults,
					 "X field is not set: please specify a parameter")
			return
		if x_only is True:
			return
		if self.y is None:
			self.err(self._check_defaults,
					 "Y field is not set: please specify a parameter")
			return
651504
def validate(self):
        
        if self.nregions is None:
            raise TypeError("neutral regions cannot be None")
        if self.sregions is None:
            raise TypeError("selected regions cannot be None")
        if self.recregions is None:
            raise TypeError("recombination regions cannot be None")
        if self.demography is None:
            raise TypeError("demography cannot be None")
        if self.prune_selected is None:
            raise TypeError("prune_selected cannot be None")
        if self.gvalue is None:
            raise TypeError("gvalue cannot be None")
        if self.rates is None:
            raise TypeError("rates cannot be None")
111364
def _check_exclusive_parameters(self, **kwargs):
        
        if len(self._meta_data['exclusive_attributes']) > 0:
            attr_set = set(list(iterkeys(kwargs)))
            ex_set = set(self._meta_data['exclusive_attributes'][0])
            common_set = sorted(attr_set.intersection(ex_set))
            if len(common_set) > 1:
                cset = ', '.join(common_set)
                error = 'Mutually exclusive arguments submitted. ' \
                        'The following arguments cannot be set ' \
                        'together: "%s".' % cset
                raise ExclusiveAttributesPresent(error)
494723
def is_optional(self):
        
        if (('optional' in self.attributes and bool(self.attributes['optional'].strip())) and
                ('minValue' in self.attributes and self.attributes['minValue'] == 0)):
            return True
        else:
            return False
727190
def validate_options(self, k, v):
        """"""

        super().validate_options(k, v)
        if k == 'mode' and v not in MODE:
            raise ValueError("{}: '{}' is not a valid value for '{}'".format(self.__class__.__name, v, k))
600072
def validate(self, raw_data, **kwargs):
        
        super(BooleanField, self).validate(raw_data, **kwargs)
        if isinstance(raw_data, string_types):
            valid_data = raw_data.strip().lower() == 'true'
        elif isinstance(raw_data, bool):
            valid_data = raw_data
        else:
            valid_data = raw_data > 0
        return valid_data
330450
function checkOptions ( opts ) {
        var isNum, isNumWithUnit;

        if ( opts.direction && !( opts.direction === 'vertical' || opts.direction === 'horizontal' || opts.direction === 'both' ) ) {
            throw new Error( 'Invalid option value: direction = "' + opts.direction + '"' );
        }

        if ( opts.box && !( opts.box === 'border-box' || opts.box === 'content-box' ) ) {
            throw new Error( 'Invalid option value: box = "' + opts.box + '"' );
        }

        if ( opts.tolerance !== undefined ) {
            isNum = isNumber( opts.tolerance );
            isNumWithUnit = isString( opts.tolerance ) && ( /^[+-]?\d*\.?\d+(px|%)?$/.test( opts.tolerance ) );
            if ( ! ( isNum || isNumWithUnit ) ) throw new Error( 'Invalid option value: tolerance = "' + opts.tolerance + '"' );
        }

    }
206213
def _validate_value(self, proposal):
        ""
        try:
            return tuple(findvalue(self._options_values, i, self.equals) for i in proposal.value)
        except ValueError:
            raise TraitError('Invalid selection: value not found')
662313
def _string_check(self, value, allow_list=False):
        '''
        
        '''
        if self._optcre is self.OPTCRE or value:
            is_list = isinstance(value, list)
            if is_list and not allow_list:
                raise TypeError('option value cannot be a list unless allow_list is True')
            elif not is_list:
                value = [value]
            if not all(isinstance(x, six.string_types) for x in value):
                raise TypeError('option values must be strings')
1161239
def validate_options(self, k, v):
        """"""

        args = [self.__class__.__name__, k]
        # Booleans
        if isinstance(self.config[k], bool) and not isinstance(v, bool):
            raise ValueError("{}: option '{}' must be a bool type.".format(*args))
        # Strings
        elif isinstance(self.config[k], str) and not isinstance(v, str):
            raise ValueError("{}: option '{}' must be a str type.".format(*args))
        # Integers (whole floats allowed)
        elif (
            isinstance(self.config[k], int) and
            (not isinstance(v, int) and not (isinstance(v, float) and v.is_integer()))
        ):
            raise ValueError("{}: option '{}' must be a int type.".format(*args))
        # Floats (integers allowed)
        elif isinstance(self.config[k], float) and not isinstance(v, (int, float)):
            raise ValueError("{}: option '{}' must be a float type.".format(*args))
        # Basic iterables (list, tuple, sets)
        elif isinstance(self.config[k], (list, tuple, set)) and not isinstance(v, list):
            raise ValueError("{}: option '{}' must be a float type.".format(*args))
        # Dictionaries
        elif isinstance(self.config[k], (dict, OrderedDict)) and not isinstance(v, (dict, OrderedDict)):
            raise ValueError("{}: option '{}' must be a dict type.".format(*args))