Returns the value of a given option for a given rule. LintConfigErrors will be raised if the
        rule or option don't exist.
490034
def get_rule_option(self, rule_name_or_id, option_name):
        
        option = self._get_option(rule_name_or_id, option_name)
        return option.value
580136
def special_get_field(self, value, args, kwargs, format_spec=None):
        """"""
        if value in self.chain:
            raise BadOptionFormat("Recursive option", chain=self.chain + [value])
1342604
public String getConfigurationOptionValue (String optionName, String defaultValue) {
		String optionValue;
		Node configurationOption = this.getConfigurationOption (optionName);
		if (configurationOption != null) {
			optionValue = configurationOption.getTextContent ();
		} else {
			optionValue = defaultValue;
		}
		return optionValue;
	}
825873
def get_or(self, default: T) -> T:
        
        return default if self.value is None else self.value
822793
def get_choice(cls, value):
        
        attribute_for_value = cls.attributes[value]
        return cls._fields[attribute_for_value]
279536
public String getRule() {
    if (Clause_Type.featOkTst && ((Clause_Type)jcasType).casFeat_rule == null)
      jcasType.jcas.throwFeatMissing("rule", "com.digitalpebble.rasp.Clause");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Clause_Type)jcasType).casFeatCode_rule);}
368906
def should_ignore_rule(self, rule):
        
        return rule.id in self.config.ignore or rule.name in self.config.ignore
803518
public final <T> T getOption(String name)
    {
        if (arguments == null)
        {
            throw new IllegalStateException("setArgs not called");
        }
        Object value = options.get(name);
        if (value == null)
        {
            Option opt = map.get(name);
            if (opt == null)
            {
                throw new IllegalArgumentException("option "+name+" not found");
            }
            if (opt.defValue != null)
            {
                return (T) opt.defValue;
            }
            if (!opt.mandatory)
            {
                return null;
            }
            throw new IllegalArgumentException(name+" not found");
        }
        return (T) 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
156594
def get(self, option, default=undefined, cast=undefined):
        
        if option in self.repository:
            value = self.repository.get(option)
        else:
            value = default

        if isinstance(value, Undefined):
            raise UndefinedValueError('%s option not found and default value was not defined.' % option)

        if isinstance(cast, Undefined):
            cast = lambda v: v  # nop
        elif cast is bool:
            cast = self._cast_boolean

        return cast(value)
851041
public function getRule()
    {
        $returnValue = (string) '';

        
         // JSON ENCODE the value to get quote when quote are required function of the variable base type
        // not so easy ;)
        //$returnValue = json_encode($this->value);
        // @todo make usable for complex variable such as pair, directed pair ..
        // @todo centralize the management of the options (attributes)
        $options = Array();
        $value = null;
        
        switch ($this->attributes['baseType']){
            case "boolean":
                $options['type'] = "boolean";
                $value = json_encode ($this->value);
                break;
            case "integer":
                $options['type'] = "integer";
                $value = json_encode ($this->value);
                break;
            case "float":
                $options['type'] = "float";
                $value = json_encode ($this->value);
                break;
            case "identifier":
            case "string":
                $options['type'] = "string";
                $value = json_encode ($this->value);
                break;
            case "pair":
                $options['type'] = "list";
                $value = '"'.implode ('","', $this->value).'"';
                break;
            case "directedPair":
                $options['type'] = "tuple";
                $value = '"'.implode ('","', (array)$this->value).'"'; // Méchant casting, won't work with a dictionnary, but with a tuple it is okay
                break;
            default:
                throw new common_Exception("taoQTI_models_classes_QTI_response_BaseValue::getRule an error occured : the type ".$this->attributes['baseType']." is unknown");
        }

        $returnValue = 'createVariable('
            . (count($options) ? '"'.addslashes(json_encode($options)).'"' : 'null') .
            ', '. $value .
        ')';
        

        return (string) $returnValue;
    }
744890
function(field, rule) {
            var
              $field       = module.get.field(field.identifier),
              type         = rule.type,
              value        = $field.val(),
              isValid      = true,
              ancillary    = module.get.ancillaryValue(rule),
              ruleName     = module.get.ruleName(rule),
              ruleFunction = settings.rules[ruleName]
            ;
            if( !$.isFunction(ruleFunction) ) {
              module.error(error.noRule, ruleName);
              return;
            }
            // cast to string avoiding encoding special values
            value = (value === undefined || value === '' || value === null)
              ? ''
              : $.trim(value + '')
            ;
            return ruleFunction.call($field, value, ancillary);
          }
641784
def get_value(self, node):
        """"""
        if not isinstance(node, ast.Attribute):
            raise TypeError("must be an attribute")

        if node.value.id != self.choices.__name__:
            raise TypeError("must be an attribute of {}".format(self.choices.__name__))

        return getattr(self.choices, node.attr)
91004
def get_options(cls, items, options, warnfn):
        ""
        options = cls.update_options(options, items)
        for keyword in cls.defaults:
            if keyword in items:
                value = items[keyword]
                allowed = cls.allowed[keyword]
                if isinstance(allowed, set):  pass
                elif isinstance(allowed, dict):
                    if not isinstance(value, dict):
                        raise ValueError("Value %r not a dict type" % value)
                    disallowed = set(value.keys()) - set(allowed.keys())
                    if disallowed:
                        raise ValueError("Keywords %r for %r option not one of %s"
                                         % (disallowed, keyword, allowed))
                    wrong_type = {k: v for k, v in value.items()
                                  if not isinstance(v, allowed[k])}
                    if wrong_type:
                        errors = []
                        for k,v in wrong_type.items():
                            errors.append("Value %r for %r option's %r attribute not of type %r" %
                                          (v, keyword, k, allowed[k]))
                        raise ValueError('\n'.join(errors))
                elif isinstance(allowed, list) and value not in allowed:
                    if keyword in cls.custom_exceptions:
                        cls.custom_exceptions[keyword](value, keyword, allowed)
                    else:
                        raise ValueError("Value %r for key %r not one of %s"
                                         % (value, keyword, allowed))
                elif isinstance(allowed, tuple):
                    if not (allowed[0] <= value <= allowed[1]):
                        info = (keyword,value)+allowed
                        raise ValueError("Value %r for key %r not between %s and %s" % info)
                options[keyword] = value
        return cls._validate(options, items, warnfn)
975903
def GetValue(self, ignore_error=True):
    """"""
    if self.HasField("none"):
      return None

    field_names = [
        "integer", "string", "data", "boolean", "list", "dict", "rdf_value",
        "float", "set"
    ]

    values = [getattr(self, x) for x in field_names if self.HasField(x)]

    if len(values) != 1:
      return None

    if self.HasField("boolean"):
      return bool(values[0])

    # Unpack RDFValues.
    if self.HasField("rdf_value"):
      try:
        rdf_class = rdfvalue.RDFValue.classes[self.rdf_value.name]
        return rdf_class.FromSerializedString(
            self.rdf_value.data, age=self.rdf_value.age)
      except (ValueError, KeyError) as e:
        if ignore_error:
          return e

        raise

    elif self.HasField("list"):
      return [x.GetValue() for x in self.list.content]

    elif self.HasField("set"):
      return set([x.GetValue() for x in self.set.content])

    else:
      return values[0]
216212
def GetValue(self):
    '''
    
    '''
    self.AssertInitialization('Choice')
    if self._widget.GetValue() == self._DEFAULT_VALUE:
      return None
    return ' '.join(
      [self._action.option_strings[0] if self._action.option_strings else '',  # get the verbose copy if available
       self._widget.GetValue()])
1221388
public final EObject ruleOptions() throws RecognitionException {
        EObject current = null;

        Token otherlv_1=null;
        Token otherlv_2=null;
        Token otherlv_4=null;
        EObject lv_optionValues_3_0 = null;


         enterRule(); 
            
        try {
            // InternalSimpleAntlr.g:168:28: ( ( () otherlv_1= 'options' otherlv_2= '{' ( (lv_optionValues_3_0= ruleOptionValue ) )+ otherlv_4= '}' ) )
            // InternalSimpleAntlr.g:169:1: ( () otherlv_1= 'options' otherlv_2= '{' ( (lv_optionValues_3_0= ruleOptionValue ) )+ otherlv_4= '}' )
            {
            // InternalSimpleAntlr.g:169:1: ( () otherlv_1= 'options' otherlv_2= '{' ( (lv_optionValues_3_0= ruleOptionValue ) )+ otherlv_4= '}' )
            // InternalSimpleAntlr.g:169:2: () otherlv_1= 'options' otherlv_2= '{' ( (lv_optionValues_3_0= ruleOptionValue ) )+ otherlv_4= '}'
            {
            // InternalSimpleAntlr.g:169:2: ()
            // InternalSimpleAntlr.g:170:2: 
            {
            if ( state.backtracking==0 ) {
               
              	  /* */ 
              	
            }
            if ( state.backtracking==0 ) {

                      current = forceCreateModelElement(
                          grammarAccess.getOptionsAccess().getOptionsAction_0(),
                          current);
                  
            }

            }

            otherlv_1=(Token)match(input,15,FOLLOW_7); if (state.failed) return current;
            if ( state.backtracking==0 ) {

                  	newLeafNode(otherlv_1, grammarAccess.getOptionsAccess().getOptionsKeyword_1());
                  
            }
            otherlv_2=(Token)match(input,16,FOLLOW_3); if (state.failed) return current;
            if ( state.backtracking==0 ) {

                  	newLeafNode(otherlv_2, grammarAccess.getOptionsAccess().getLeftCurlyBracketKeyword_2());
                  
            }
            // InternalSimpleAntlr.g:186:1: ( (lv_optionValues_3_0= ruleOptionValue ) )+
            int cnt3=0;
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( (LA3_0==RULE_ID) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // InternalSimpleAntlr.g:187:1: (lv_optionValues_3_0= ruleOptionValue )
            	    {
            	    // InternalSimpleAntlr.g:187:1: (lv_optionValues_3_0= ruleOptionValue )
            	    // InternalSimpleAntlr.g:188:3: lv_optionValues_3_0= ruleOptionValue
            	    {
            	    if ( state.backtracking==0 ) {
            	       
            	      	        newCompositeNode(grammarAccess.getOptionsAccess().getOptionValuesOptionValueParserRuleCall_3_0()); 
            	      	    
            	    }
            	    pushFollow(FOLLOW_8);
            	    lv_optionValues_3_0=ruleOptionValue();

            	    state._fsp--;
            	    if (state.failed) return current;
            	    if ( state.backtracking==0 ) {

            	      	        if (current==null) {
            	      	            current = createModelElementForParent(grammarAccess.getOptionsRule());
            	      	        }
            	             		add(
            	             			current, 
            	             			"optionValues",
            	              		lv_optionValues_3_0, 
            	              		"org.eclipse.xtext.generator.parser.antlr.debug.SimpleAntlr.OptionValue");
            	      	        afterParserOrEnumRuleCall();
            	      	    
            	    }

            	    }


            	    }
            	    break;

            	default :
            	    if ( cnt3 >= 1 ) break loop3;
            	    if (state.backtracking>0) {state.failed=true; return current;}
                        EarlyExitException eee =
                            new EarlyExitException(3, input);
                        throw eee;
                }
                cnt3++;
            } while (true);

            otherlv_4=(Token)match(input,17,FOLLOW_2); if (state.failed) return current;
            if ( state.backtracking==0 ) {

                  	newLeafNode(otherlv_4, grammarAccess.getOptionsAccess().getRightCurlyBracketKeyword_4());
                  
            }

            }


            }

            if ( state.backtracking==0 ) {
               leaveRule(); 
            }
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }