Return the value of a given option
        
        :param opt_name: option name
        :type opt_name: str
        
        :returns: the value of the option
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
341374
def _pick_selected_option(cls):
        
        for option in cls.select_el:
            # if the select is empty
            if not hasattr(option, "selected"):
                return None

            if option.selected:
                return option.value

        return None
1054054
function opt(options, name, defaultValue){
    return options && options[name]!==undefined ? options[name] : defaultValue;
}
356683
def get_custom_value(self, field_name):
        
        custom_field = self.get_custom_field(field_name)
        return CustomFieldValue.objects.get_or_create(
            field=custom_field, object_id=self.id)[0].value
1141273
def _get_opt(config, key, option, opt_type):
    """"""
    for opt_key in [option, option.replace('-', '_')]:
        if not config.has_option(key, opt_key):
            continue

        if opt_type == bool:
            return config.getbool(key, opt_key)

        if opt_type == int:
            return config.getint(key, opt_key)

        if opt_type == str:
            return config.get(key, opt_key)

        if opt_type == list:
            return _parse_list_opt(config.get(key, opt_key))

        raise ValueError("Unknown option type: %s" % opt_type)
834558
def get_attribute_option(self, attribute, option_name):
        
        self.__validate_attribute_option_name(option_name)
        attribute_key = self.__make_key(attribute)
        return self.__attribute_options[attribute_key].get(option_name)
1118881
def get_method_returning_field_value(self, field_name):
        
        method = getattr(self, field_name, None)
        return method if method and callable(method) else None
1185635
public function getOption($name, $option = null)
    {
        $postTypes = Configure::read('CA.PostTypes');

        if (array_key_exists($name, $postTypes)) {
            if ($option) {
                if (array_key_exists($option, $postTypes[$name])) {
                    return $postTypes[$name][$option];
                }
            }
            return $postTypes[$name];
        }
        return false;
    }
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;
    }
635225
def get_options(self):
        
        choices = self._field_choices()
        if choices:
            return [c[1] for c in choices]
        else:
            return self.model.objects.\
                order_by(self.name).\
                values_list(self.name, flat=True)
1343152
def set_option(self, optionname, value):
        
        for name, parms in zip(self.opt_names, self.opt_parms):
            if name == optionname:
                # FIXME: ensure that the resulting type of the set option
                # matches that of the default value. This prevents a string
                # option from being coerced to int simply because it holds
                # a numeric value (e.g. a password).
                # See PR #1526 and Issue #1597
                defaulttype = type(parms['enabled'])
                if defaulttype != type(value) and defaulttype != type(None):
                    value = (defaulttype)(value)
                parms['enabled'] = value
                return True
        else:
            return False
783310
def form_option(str_opt):
    '''
    '''

    str_base = '#cmdoption-arg-'
    str_opt_x = str_base+str_opt.lower()\
        .replace('_', '-')\
        .replace('(', '-')\
        .replace(')', '')
    return str_opt_x
594168
def _option(self):
        
        class Options(object):
            def __getitem__(_self, name):
                return self.getOption(name)

            def __setitem__(_self, name, value):
                self.setOption(name, value)

        return Options()
626418
def getOption(self, name):
    
    name = name.strip()
    for o in self.options:
      if o.short == name or o.long == name:
        return o
    raise InterfaceException("No such option: " + name)
438151
def get_parameter(self, name):
        
        for parameter in self._parameters:
            if parameter.name == name:
                return parameter
1117983
def GetValue(self):
    '''
    
    '''
    if not self._widget.GetValue() or len(self._widget.GetValue()) <= 0:
        return None
    else:
        return self._action.option_strings[0]
479526
def select_param(param_name, default=None):
    

    def select_param(_value, _context, **params):
        return params.pop(param_name, default)

    return select_param