Option accessor in functional style:
   obj.option(:option, 'value')
   obj.option(:option)   => 'value'
163168
def option(option, *args)
      args.size > 0 ? set(option, args.first) : get(option)
    end
1279668
function getOption(opts) {
  return {
    tag: 'option',
    attrs: {
      disabled: opts.disabled,
      value: opts.value
    },
    children: opts.text,
    key: opts.value
  };
}
997819
def get(self, option, default=None):
        ''''''
        val = self[option]
        return (val is None and default) or val
414843
def get_alt(self, option):
        
        assert hasattr(self, option)

        alt = option + '_alt'
        if not hasattr(self, alt):
            return ''
        return ', '.join(self.__dict__[alt])
136780
def _value(obj):
    
    # TODO: this is ugly and makes everything ugly
    # can we handle this with a clean decorator or just requiring that only floats be passed??
    if hasattr(obj, 'value'):
        return obj.value
    elif isinstance(obj, np.ndarray):
        return np.array([o.value for o in obj])
    elif hasattr(obj, '__iter__'):
        return [_value(o) for o in obj]
    return obj
347123
def option(func, *args, **attrs):
    
    if click is None:
        return func

    def decorator(f):
        name = attrs.pop("name", func.__name__.replace("_", "-"))
        attrs.setdefault("help", func.__doc__)
        attrs.setdefault("required", False)
        if not attrs.get("is_flag"):
            attrs.setdefault("show_default", True)
            attrs.setdefault("metavar", name.replace("-", "_").upper())
            attrs.setdefault("type", str)
        if not name.startswith("-"):
            name = "--%s" % name
        return click.option(name, *args, **attrs)(f)

    return decorator
141632
function Type(opt) {
	CallableValue.call(this);
	this.opt = opt || {};
	this.isReaded = false;
	this.isWritten = false;
}
437131
def define_option_method(option)
      class_eval <<-RUBY, __FILE__, __LINE__ + 1
        def self.#{option}(value = Undefined)           # def self.primitive(value = Undefined)
          @#{option} = nil unless defined?(@#{option})  #   @primitive = nil unless defined?(@primitive)
          return @#{option} if value.equal?(Undefined)  #   return @primitive if value.equal?(Undefined)
          @#{option} = value                            #   @primitive = value
          self                                          #   self
        end                                             # end
      RUBY
    end
382678
function getOption(opts, key, def) {
  var value = opts[key];
  return value === undefined ? def : value;
}
973535
def raw_get(option)
      value = options_storage[option]
      Confo.callable_without_arguments?(value) ? value.call : value
    end
944410
def _parse_option(option):
    
    try:
        key, val = option.split("=", 1)
    except ValueError:
        return option, True

    try:
        val = json.loads(val)
    except json.JSONDecodeError:
        pass

    return key, val
1285597
function(obj, options) {
	options = _.defaults(options || {}, {
		'reference': 'reference',
		'access': true
	});

	this.doc = obj.doc || obj;
	this.id = obj.id || obj._id;
	this.view = options.view;

	// make the "key" conform to the convention ["key"]
	this.key = obj.key || this.doc[options.view];
	this.key = _.isArray( obj.key ) ? obj.key : [ obj.key ];

	// init the value object
	if (_.isArray(options.related_facet)) {
		this.value = _.reduce(options.related_facet, function(result, fV) {
			result[fV] = {};
			return result;
		}, {});
	} else {
		this.value = _.object([options.related_facet], [{}]);
	}
	
	// make the value accessible via the "key";
	if (this.doc && options.view) {
		if (!_.contains(['key', 'value', 'id', 'doc', 'view'], options.view)) {
			this[options.view] = this.doc[options.view];
		}
	}

	// Default behavior when "options.related_facet" is present:
	// calculate a new value set when the requested "key" is not the "key" used to compute the index.
	// NB: this over-writes the .value fetched from the server;
	if (options.related_facet && this.hasOwnProperty('doc') &&
			this.getAlias('type') !== options.reference) {
		this.setValues(this._getRelatedValues(options.related_facet));
	}
	return this;
}
303732
def option(name, type = nil, **opts, &block)
      add_definition(true, name, type, block, opts)
    end
532906
def set(option, value=(not_set=true), ignore_setter=false, &block)
      raise ArgumentError, 'value not set' if block and !not_set
      return self if !not_set and value.nil?

      if not_set
        set_options option
        return self
      end

      if respond_to?("#{option}=") and not ignore_setter
        return __send__("#{option}=", value)
      end

      define_accessors option, value
      self
    end
379181
def get(self, value, cfg=None):
        
        if value is None and cfg:
            if self.option_type == 'list':
                value = cfg.get_list(self.name, None)
            else:
                value = cfg.get(self.name, None)

        if value is None:
            value = self.default
        else:
            parse_method = getattr(self, 'parse_%s' % (self.option_type), None)
            if parse_method:
                value = parse_method(value)
        return value
954528
function decorator(fn) {
	return opt => (
		typeof opt==='function' ? fn(opt) : (target, key, desc) => {
			desc.value = fn(desc.value, opt, target, key, desc);
		}
	);
}
522402
def option_getter(type):
    
    option_getters = {None: ConfigParser.get,
                      int: ConfigParser.getint,
                      float: ConfigParser.getfloat,
                      bool: ConfigParser.getboolean}
    return option_getters.get(type, option_getters[None])