Check if an option is already in the message.

        :type option: Option
        :param option: the option to be checked
        :return: True if already present, False otherwise
774702
def _already_in(self, option):
        
        for opt in self._options:
            if option.number == opt.number:
                return True
        return False
1359514
def _check_remote_option(self, option):
        """"""
        if not self.telnet_opt_dict.has_key(option):
            self.telnet_opt_dict[option] = TelnetOption()
        return self.telnet_opt_dict[option].remote_option
597001
def _validate_options(options, service_name, add_error):
    
    if options is None:
        return
    if not isdict(options):
        add_error('service {} has malformed options'.format(service_name))
562128
def _check_categorical_option_type(option_name, option_value, possible_values):
    
    err_msg = '{0} is not a valid option for {1}. '.format(option_value, option_name)
    err_msg += ' Expected one of: '.format(possible_values)

    err_msg += ', '.join(map(str, possible_values))
    if option_value not in possible_values:
        raise ToolkitError(err_msg)
1234479
def option(self, section, option):
        
        if self.config.has_section(section):
            if self.config.has_option(section, option):
                return (True, self.config.get(section, option))
            return (False, 'Option: ' + option + ' does not exist')
        return (False, 'Section: ' + section + ' does not exist')
532486
def check_valid(self):
		
		for k,input in self.inputs.items():
			if k in self.valid_opts:
				for param in self.valid_opts[k]:
					if param is None or input is None:
						return True
					elif type(param) is str and '+' in param:
						if re.search(r'^'+param,str(input)):
							return True
					elif type(param) is bool and type(input) is bool:
						return True
					elif type(param) is list and type(input) is list:
						return True
					else:
						if str(input).lower() == str(param):
							return True
				raise ValueError("Invalid input for '%s' parameter. Options are: %s" % (k,' '.join(["'%s'," % str(o) for o in self.valid_opts[k]]) ))
			else:
				raise ValueError("Invalid parameter for '%s'. Params are: %s" % (self.__class__.__name__,', '.join(["'%s'" % p for p in self.valid_opts.keys()]) ))
412687
def if_match(self, values):
        
        assert isinstance(values, list)
        for v in values:
            option = Option()
            option.number = defines.OptionRegistry.IF_MATCH.number
            option.value = v
            self.add_option(option)
433864
def bump_option_validator(ctx, param, value):
    

    if value:
        try:
            value = Version(value)
        except ValueError:
            ctx.fail(f"{x_mark} {value} is not a valid version string")

    return value
543926
def get_option_value(self, opt_name):
        
        if not self.has_option(opt_name):
            raise ValueError("Unknow option name (%s)" % opt_name)
        return self._options[opt_name].value
294604
function checkOptions(opts1, opts2) {
        for (var prop in opts1) {
            if (opts1.hasOwnProperty(prop)) {
                if (opts1[prop] !== opts2[prop]) {
                    return true;
                }
            }
        }
        return false;
    }
358138
def choices(self, choices):
        

        if choices is not None and len(choices) > 0:
            self.has_choices = True

        self._choices = choices
439426
def check_save(sender, **kwargs):
    
    tag = kwargs['instance']
    obj = Tag.get_object(tag)
    previous_tags = Tag.get_tags(obj)
    
    err_uniq = check_item_type_uniqueness(tag, previous_tags)
    err_appl = check_field_applicability(tag)
    err_mult = check_field_multiplicity(tag, previous_tags)
    err_msg = generate_error_message(tag, err_uniq, err_appl, err_mult)
    if err_uniq or err_appl or err_mult:
        raise TypeError(err_msg)
746306
def has_option?(option) #:nodoc:
      option = option.gsub(/^\-+/,'')
      ((flags.values.map { |_| [_.name,_.aliases] }) + 
       (switches.values.map { |_| [_.name,_.aliases] })).flatten.map(&:to_s).include?(option)
    end
702757
def options(self, section):
        
        if self.config.has_section(section):
            return (True, self.config.options(section))
        return (False, 'Section: ' + section + ' does not exist')
797149
def __option(self):
		
		section = self.section()
		option = self.option_prefix()
		if self.config().has_option(section, option) is False:
			raise NoOptionError(option, section)
		return section, option
458730
def _AddOption(self, name):
    

    # Check for duplicate option declaration
    if name in [option.name for option in self.options]:
      raise TextFSMTemplateError('Duplicate option "%s"' % name)

    # Create the option object
    try:
      option = self._options_cls.GetOption(name)(self)
    except AttributeError:
      raise TextFSMTemplateError('Unknown option "%s"' % name)

    self.options.append(option)
855536
def valid_options(kwargs, allowed_options):
    

    diff = set(kwargs) - set(allowed_options)
    if diff:
        print("Invalid option(s): ", ', '.join(diff))
        return False
    return True