A method for declaring options for the class
174897
def Options(**kwargs):
     
     construct = GPDOptions #IMPORTANT!  Set this
     names = construct._fields
     d = {}
     for name in names: d[name] = None #default values
     for k,v in kwargs.iteritems():
       if k in names: d[k] = v
       else: raise ValueError('Error '+k+' is not a property of these options')
     """Create a set of options based on the inputs"""
     return construct(**d)
1307109
def general_option(option_cls, config = {})
      option_cls = option_cls.constantize if option_cls.is_a? String
      @general_options[option_cls] = option_cls.new(config)
    end
72301
def options(self, options):
        
        if self.is_optionhandler:
            javabridge.call(self.jobject, "setOptions", "([Ljava/lang/String;)V", typeconv.string_list_to_array(options))
399742
private void tryRegisterJava8Optionals() {
        try {
            loadType("java.util.OptionalInt");
            @SuppressWarnings("unchecked")
            Class<?> cls1 = (Class<TypedStringConverter<?>>) loadType("org.joda.convert.OptionalIntStringConverter");
            TypedStringConverter<?> conv1 = (TypedStringConverter<?>) cls1.getDeclaredConstructor().newInstance();
            registered.put(conv1.getEffectiveType(), conv1);

            @SuppressWarnings("unchecked")
            Class<?> cls2 = (Class<TypedStringConverter<?>>) loadType("org.joda.convert.OptionalLongStringConverter");
            TypedStringConverter<?> conv2 = (TypedStringConverter<?>) cls2.getDeclaredConstructor().newInstance();
            registered.put(conv2.getEffectiveType(), conv2);

            @SuppressWarnings("unchecked")
            Class<?> cls3 = (Class<TypedStringConverter<?>>) loadType("org.joda.convert.OptionalDoubleStringConverter");
            TypedStringConverter<?> conv3 = (TypedStringConverter<?>) cls3.getDeclaredConstructor().newInstance();
            registered.put(conv3.getEffectiveType(), conv3);

        } catch (Throwable ex) {
            if (LOG) {
                System.err.println("tryRegisterOptionals: " + ex);
            }
        }
    }
313297
function toOptions (type, options) {
  if (Types.includes(type)) {
    options = Object.assign({ type: type }, options)
  }
  if (options._validated) {
    delete options._validated
    return options
  }
  if (Object.keys(options).length > 0) {
    options = baseParser._parseDefinition(
      options, { strict: true, userInput: false, _key: 'options' }
    )
  }
  return options
}
1304298
def config_option(name, default_value, options = {})
      compiler      = options.fetch(:compiler_option, nil)
      valid_values  = options.fetch(:valid_values, [true, false])

      config_options[name] = {
        default: default_value,
        compiler: compiler
      }

      define_singleton_method(name) { config.fetch(name, default_value) }
      define_singleton_method("#{name}=") do |value|
        unless valid_values.any? { |valid_value| valid_value === value }
          raise ArgumentError, "Not a valid value for option #{self}.#{name}, provided #{value.inspect}. "\
                               "Must be #{valid_values.inspect} === #{value.inspect}"
        end

        config[name] = value
      end
    end
529819
function(_default, options) {
			if(typeof _default !== "object") {
				_default = {};
			}
			if(typeof options !== "object") {
				options = {};
			}
			this.setOptions($.extend(true, {}, _default, options));
		}
1128668
private Command<? super T> createOption(String fieldName, Class<?> type) {
    if (type == Integer.class || type == int.class) {
      return new IntegerFieldOption<T>(fieldName);
    } else if (type == Long.class || type == long.class) {
      return new LongFieldOption<T>(fieldName);
    } else if (type == Boolean.class || type == boolean.class) {
      return new BooleanFieldOption<T>(fieldName);
    } else if (type == String.class) {
      return new StringFieldOption<T>(fieldName);
    } else if (type == Double.class || type == double.class) {
      return new DoubleFieldOption<T>(fieldName);
    } else if (type == Float.class || type == float.class) {
      return new FloatFieldOption<T>(fieldName);
    } else if (type == File.class) {
      return new FileFieldOption<T>(fieldName);
    }
    throw new IllegalArgumentException("Cannot create option for parameter of type `" + type.getName() + "'");
  }
246132
function (options) {
    options = options || {}
    this.isTTY = process.stdout.isTTY || false
    this.useColors = options.useColors || this.isTTY
}
1096042
def method_missing(name, *args)
      name = name.to_s
      last_char = name[-1,1]
      super(name, *args) unless last_char == "=" || last_char == "?"
      attr_name = name[0..-2].to_sym # :foo for 'foo=' or 'foo?'
      if last_char == "="
        @options[attr_name] = args.at(0)
      else
        @options[attr_name]
      end
    end
505404
function Option(handler, options, desc) {
  Option.super_.apply(this, [handler, options, desc]);

  if (options.params && options.params.hasOwnProperty('optional')) {
    throw new Error('optional parameter is not allowed for options');
  }
}
978167
function Option(options){
		// options should be an object
		if ( typeof options !== 'object' ) {
			throw new Error('options should be an object');
		}
		
		// All options except value must be provided.
		if ( !options.name || !options.description || !options.type || options.defaultValue === undefined ) {
			throw new Error('name,description, type, and defaultValue required');
		}

		// Set name of option
		this.name = options.name;

		// A description of the setting.
		this.description = options.description;

		// The type of value `this` option can have.
		if ( options.type !== Array && options.type !== Number && options.type !== Boolean &&
			options.type !== String && options.type !== Object ){

			throw new Error('Option type must be Boolean,Number,Function,String, or Object');
		}

		this.type = options.type;

		// Default value as defined by node-jshint
		this.defaultValue = options.defaultValue;

		// Current value takes default value by default.
		this.setValue( options.defaultValue );
	}
1142934
function (options) {
			
			inputEx.SelectTwiceField.superclass.setOptions.call(this, options);
			
			this.options.choices = lang.isArray(options.choices) ? options.choices : [];
			
			this.options.valueSeparator = options.valueSeparator || "_";
			
		}
911675
function(options) 
	{
		this.addEventListener(conbo.ConboEvent.CHANGE, this.__changeHandler, this, 999);
		
		var listOptions = ['itemClass'];
		
		conbo.assign(this, conbo.pick(options, listOptions));
		
		this.source = options.source || [];
	}
18061
protected void addOption(AbstractRenderAppender buffer, String type, String optionValue,
                             String optionDisplay, int idx, String altText, char accessKey, boolean disabled)
            throws JspException
    {
        ServletRequest req = pageContext.getRequest();
        if (_cr == null)
            _cr = TagRenderingBase.Factory.getConstantRendering(req);

        assert(buffer != null);
        assert(optionValue != null);
        assert(optionDisplay != null);
        assert(type != null);

        if (_orientation != null && isVertical()) {
            _cr.TR_TD(buffer);
        }

        _inputState.clear();
        _inputState.type = type;
        _inputState.name = getQualifiedDataSourceName();
        _inputState.value = optionValue;
        _inputState.style = _style;
        _inputState.styleClass = _class;

        if (isMatched(optionValue, null)) {
            _inputState.checked = true;
        }
        _inputState.disabled = isDisabled();
        _inputState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ALT, altText);
        if (accessKey != 0x00)
            _inputState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ACCESSKEY, Character.toString(accessKey));

        // if there are attributes defined push them to the options.
        if (_attrs != null && _attrs.size() > 0) {
            Iterator iterator = _attrs.keySet().iterator();
            for (; iterator.hasNext();) {
                String key = (String) iterator.next();
                if (key == null)
                    continue;

                String value = (String) _attrs.get(key);
                _inputState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, key, value);
            }
        }

        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req);
        br.doStartTag(buffer, _inputState);
        br.doEndTag(buffer);

        String ls = _labelStyle;
        String lsc = _labelStyleClass;

        _spanState.style = ls;
        _spanState.styleClass = lsc;

        br = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, req);
        br.doStartTag(buffer, _spanState);
        buffer.append(optionDisplay);
        br.doEndTag(buffer);

        // backward compatibility this is now overridden by the _orientation
        if (_orientation == null) {
            _cr.BR(buffer);
        }
        else {
            if (isVertical()) {
                _cr.TR_TD(buffer);
            }
            else {
                _cr.NBSP(buffer);
            }
        }
    }
1154219
def options
      map = Config.class_variables.map do |key|
        [key.to_s.tr('@', '').to_sym, class_variable_get(:"#{key}")]
      end
      Hash[map]
    end
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