Set the values and labels, and select the first option if we aren't initializing
325352
def _propagate_options(self, change):
        ""
        options = self._options_full
        self.set_trait('_options_labels', tuple(i[0] for i in options))
        self._options_values = tuple(i[1] for i in options)
        if self._initializing_traits_ is not True:
            if len(options) > 0:
                if self.index == 0:
                    # Explicitly trigger the observers to pick up the new value and
                    # label. Just setting the value would not trigger the observers
                    # since traitlets thinks the value hasn't changed.
                    self._notify_trait('index', 0, 0)
                else:
                    self.index = 0
            else:
                self.index = None
716959
def initialize_options(self):  # suppress(unused-function)
        """"""
        self._file_lines_cache = dict()
        self.suppress_codes = list()
        self.exclusions = list()
        self.cache_directory = ""
        self.stamp_directory = ""
        self.disable_linters = list()
        self.show_lint_files = 0
331385
function init (optionTokens = {}) {
  Object.keys(optionTokens).forEach((key) => assign(key, optionTokens[key]))
}
527755
function setSelectedOption(optionValue) {
    const optionFind = (option) => option.value.toString() === optionValue.toString();
    const newOptionSelected = find(this.state.options, optionFind);
    const newOptionSelectedValue = newOptionSelected && newOptionSelected.value;
    let options = this.state.options;

    options = options.map((option, i) => {
        if (option.value === newOptionSelectedValue) {
            option.selected = true;
            this.setState('selectedIndex', i);
            this.setState('value', option.value);
        } else {
            option.selected = false;
        }
        return option;
    });
    this.setState('options', options);
    this.update();
}
264112
def set_option(self, name, value):
        """"""
        _assert_value_is_valid(name)
        self._options[name] = value
548006
private void firstInnerTableStart(Options opt) {
	w.print(linePrefix + linePrefix + "<tr>" + opt.shape.extraColumn() +
		"<td><table border=\"0\" cellspacing=\"0\" " +
		"cellpadding=\"1\">" + linePostfix);
    }
647249
def setText(self, label, default='', description='Set Text', format='text'):
        

        obj = self.load(label)
        if obj == None:
            obj=default
            self.save(obj, label)  # initialize with default

        textw = Text(value=obj, description=description)
        hndl = interact(self.save, obj=textw, label=fixed(label), format=fixed(format))
750177
function setOptions(options) {
  // clone to prevent interference
  options = _.cloneDeep(options);

  // set deep defaults
  options = _.defaultsDeep(options, defaults);

  // ensure `text` is a string
  if (!_.isString(options.text)) throw new Error('`text` must be a String');

  // ensure `fontNameOrPath` is a string and not blank
  if (!_.isString(options.fontNameOrPath) || s.isBlank(options.fontNameOrPath))
    throw new Error('`fontNameOrPath` must be a String and not blank');

  // convert font size in pixels to number
  // and remove px, so we just convert to digits only
  if (_.isString(options.fontSize))
    options.fontSize = parseFloat(options.fontSize);

  // round to nearest whole pixel
  options.fontSize = Math.round(options.fontSize);

  // ensure it's a number greater than 0
  if (!_.isNumber(options.fontSize) || options.fontSize <= 0)
    throw new Error(
      '`fontSize` must be a Number or String that is a valid number > than 0'
    );

  // ensure `fontColor` is a string
  if (!_.isString(options.fontColor) || s.isBlank(options.fontColor))
    throw new Error('`fontColor` must be a String and not blank');

  // ensure `backgroundColor` is a string
  if (
    !_.isString(options.backgroundColor) ||
    s.isBlank(options.backgroundColor)
  )
    throw new Error('`backgroundColor` must be a String and not blank');

  // ensure supportsFallback is a boolean else true
  if (!_.isBoolean(options.supportsFallback))
    throw new Error('`supportsFallback` must be a Boolean');

  // ensure resizeToFontSize is a boolean else true
  if (!_.isBoolean(options.resizeToFontSize))
    throw new Error('`resizeToFontSize` must be a Boolean');

  // ensure trim is a boolean else true
  if (!_.isBoolean(options.trim)) throw new Error('`trim` must be a Boolean');

  // ensure trimTolerance is a number else 10
  if (
    !_.isNumber(options.trimTolerance) ||
    options.trimTolerance < 1 ||
    options.trimTolerance > 99
  )
    throw new Error(
      '`trimTolerance` must be a Number between 1 and 99 inclusive'
    );

  // if `textToSvg.attributes.fill` is not set
  // then set it equal to `fontColor`
  if (!_.isString(options.textToSvg.attributes.fill))
    options.textToSvg.attributes.fill = options.fontColor;

  // if `textToSvg.fontSize` not set, then we will calculate
  // what the `fontSize` should be based off height of font
  if (!_.isNumber(options.textToSvg.fontSize))
    options.textToSvg.fontSize = options.fontSize;

  // if `fontNameOrPath` was not a valid font path (with smart detection)
  // then result to use `getClosestFontName` and `getFontPathByName`
  try {
    const ext = path.extname(options.fontNameOrPath);
    const fontName = path.basename(options.fontNameOrPath, ext);

    if (_.includes(fontExtensions, ext)) {
      const stats = fs.statSync(path.resolve(options.fontNameOrPath));
      if (!stats.isFile())
        throw new Error(
          `${path.resolve(options.fontNameOrPath)} was not a valid file`
        );

      options.fontPath = path.resolve(options.fontNameOrPath);
      options.fontName = fontName;
    } else {
      const fontDir = path.dirname(path.resolve(options.fontNameOrPath));

      let data = _.map(fontExtensions, ext => {
        const filePath = `${fontDir}/${fontName}.${ext}`;
        try {
          const stats = fs.statSync(filePath);
          return stats.isFile() ? filePath : false;
        } catch (error) {
          return false;
        }
      });

      // remove false matches
      data = _.compact(data);

      // if this was a directory path then throw an error that it was not found
      if (options.fontNameOrPath.indexOf(path.sep) !== -1 && data.length === 0)
        throw new Error(
          `\`fontNameOrPath\` "${options.fontNameOrPath}" file was not found`
        );

      if (data.length > 0) {
        options.fontName = fontName;
        options.fontPath = data[0];
      } else {
        options.fontName = getClosestFontName(options.fontNameOrPath);
        options.fontPath = getFontPathByName(options.fontName);
      }
    }

    return options;
  } catch (error) {
    throw error;
  }
}
1165948
function () {
            var selected = [];
            var items = this._data.items;
            for (var i = 0; i < items.length; i++) {
                if (!items[i].initiallyDisabled) {
                    selected.push(items[i].value);
                }
            }
            this.setSelectedValues(selected);
            if (this._data) {
                this.json.setValue(this._data, "focusIndex", 0);
            }
        }
289372
def initialize_options(self):
        """"""
        self.dep_groups = ''
        self.dep_quote = False
        self.dep_conda = False
602668
protected function set_preset() {

		// Set preset from the choices.
		$this->preset = $this->choices;

		// We're using a flat select.
		foreach ( $this->choices as $key => $args ) {
			$this->choices[ $key ] = $args['label'];
		}
	}
1009591
void setOption(String[] opt) {
	if(!matchOption(opt[0], "hide") && optionLength(opt[0]) > opt.length) {
	    System.err.println("Skipping option '" + opt[0] + "', missing argument");
	    return;
	}
	boolean dash = opt[0].length() > 1 && opt[0].charAt(0) == '-';
	boolean positive = !(opt[0].length() > 1 && opt[0].charAt(dash ? 1 : 0) == '!');
	
	if(matchOption(opt[0], "qualify", true)) {
	    showQualified = positive;
	} else if(matchOption(opt[0], "qualifyGenerics", true)) {
	    showQualifiedGenerics = positive;
	} else if(matchOption(opt[0], "hideGenerics", true)) {
	    hideGenerics = positive;
	} else if(matchOption(opt[0], "horizontal", true)) {
	    horizontal = positive;
	} else if(matchOption(opt[0], "attributes", true)) {
	    showAttributes = positive;
	} else if(matchOption(opt[0], "enumconstants", true)) {
	    showEnumConstants = positive;
	} else if(matchOption(opt[0], "operations", true)) {
	    showOperations = positive;
	} else if(matchOption(opt[0], "enumerations", true)) {
	    showEnumerations = positive;
	} else if(matchOption(opt[0], "constructors", true)) {
	    showConstructors = positive;
	} else if(matchOption(opt[0], "visibility", true)) {
	    showVisibility = positive;
	} else if(matchOption(opt[0], "types", true)) {
	    showType = positive;
	} else if(matchOption(opt[0], "autoSize", true)) {
	    autoSize = positive;
	} else if(matchOption(opt[0], "commentname", true)) {
	    showComment = positive;
	} else if(matchOption(opt[0], "all")) {
	    setAll();
	} else if(matchOption(opt[0], "bgcolor", true)) {
	    bgColor = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "edgecolor", true)) {
	    edgeColor = positive ? opt[1] : "black";
	} else if(matchOption(opt[0], "edgefontcolor", true)) {
	    edgeFontColor = positive ? opt[1] : "black";
	} else if(matchOption(opt[0], "edgefontname", true)) {
	    edgeFontName = positive ? opt[1] : Font.DEFAULT_FONT;
	} else if(matchOption(opt[0], "edgefontsize", true)) {
	    edgeFontSize = positive ? Double.parseDouble(opt[1]) : 10;
	} else if(matchOption(opt[0], "nodefontcolor", true)) {
	    nodeFontColor = positive ? opt[1] : "black";
	} else if(matchOption(opt[0], "nodefontname", true)) {
	    nodeFontName = positive ? opt[1] : Font.DEFAULT_FONT;
	} else if(matchOption(opt[0], "nodefontabstractitalic", true)) {
	    nodeFontAbstractItalic = positive;
	} else if(matchOption(opt[0], "nodefontsize", true)) {
	    nodeFontSize = positive ? Double.parseDouble(opt[1]) : 10;
	} else if(matchOption(opt[0], "nodefontclassname", true)) {
	    nodeFontClassName = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "nodefontclasssize", true)) {
	    nodeFontClassSize = positive ? Double.parseDouble(opt[1]) : -1;
	} else if(matchOption(opt[0], "nodefonttagname", true)) {
	    nodeFontTagName = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "nodefonttagsize", true)) {
	    nodeFontTagSize = positive ? Double.parseDouble(opt[1]) : -1;
	} else if(matchOption(opt[0], "nodefontpackagename", true)) {
	    nodeFontPackageName = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "nodefontpackagesize", true)) {
	    nodeFontPackageSize = positive ? Double.parseDouble(opt[1]) : -1;
	} else if(matchOption(opt[0], "nodefillcolor", true)) {
	    nodeFillColor = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "shape", true)) {
	    shape = positive ? Shape.of(opt[1]) : Shape.CLASS;
	} else if(matchOption(opt[0], "output", true)) {
	    outputFileName = positive ? opt[1] : "graph.dot";
	} else if(matchOption(opt[0], "outputencoding", true)) {
	    outputEncoding = positive ? opt[1] : "ISO-8859-1";
	} else if(matchOption(opt[0], "hide", true)) {
	    if (positive) {
		if (opt.length == 1) {
		    hidePatterns.clear();
		    hidePatterns.add(allPattern);
		} else {
		    try {
			hidePatterns.add(Pattern.compile(opt[1]));
		    } catch (PatternSyntaxException e) {
			System.err.println("Skipping invalid pattern " + opt[1]);
		    }
		}
	    } else
		hidePatterns.clear();
	} else if(matchOption(opt[0], "include", true)) {
	    if (positive) {
		try {
		    includePatterns.add(Pattern.compile(opt[1]));
		} catch (PatternSyntaxException e) {
		    System.err.println("Skipping invalid pattern " + opt[1]);
		}
	    } else
		includePatterns.clear();
	} else if(matchOption(opt[0], "apidocroot", true)) {
	    apiDocRoot = positive ? fixApiDocRoot(opt[1]) : null;
	} else if(matchOption(opt[0], "apidocmap", true)) {
	    if (positive)
		setApiDocMapFile(opt[1]);
	    else
		apiDocMap.clear();
	} else if(matchOption(opt[0], "noguillemot", true)) {
	    guilOpen = positive ? "&lt;&lt;" : "\u00ab";
	    guilClose = positive ? "&gt;&gt;" : "\u00bb";
	} else if (matchOption(opt[0], "view", true)) {
	    viewName = positive ? opt[1] : null;
	} else if (matchOption(opt[0], "views", true)) {
	    findViews = positive;
	} else if (matchOption(opt[0], "d", true)) {
	    outputDirectory = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "inferrel", true)) {
	    inferRelationships = positive;
	} else if(matchOption(opt[0], "inferreltype", true)) {
	    if (positive) {
		try {
		    inferRelationshipType = RelationType.valueOf(opt[1].toUpperCase());
		} catch(IllegalArgumentException e) {
		    System.err.println("Unknown association type " + opt[1]);
		}
	    } else 
		inferRelationshipType = RelationType.NAVASSOC;
	} else if(matchOption(opt[0], "inferdepvis", true)) {
	    if (positive) {
		try {
		    Visibility vis = Visibility.valueOf(opt[1].toUpperCase());
		    inferDependencyVisibility = vis;
		} catch(IllegalArgumentException e) {
		    System.err.println("Ignoring invalid visibility specification for " +
			    "dependency inference: " + opt[1]);
		}
	    } else
		inferDependencyVisibility = Visibility.PRIVATE;
	} else if(matchOption(opt[0], "collapsible", true)) {
	    collapsibleDiagrams = positive;
	} else if(matchOption(opt[0], "inferdep", true)) {
	    inferDependencies = positive;
	} else if(matchOption(opt[0], "inferdepinpackage", true)) {
	    inferDepInPackage = positive;
	} else if (matchOption(opt[0], "hideprivateinner", true)) {
	    hidePrivateInner = positive;
	} else if(matchOption(opt[0], "useimports", true)) {
	    useImports = positive;
	} else if (matchOption(opt[0], "collpackages", true)) {
	    if (positive) {
		try {
		    collPackages.add(Pattern.compile(opt[1]));
		} catch (PatternSyntaxException e) {
		    System.err.println("Skipping invalid pattern " + opt[1]);
		}
	    } else
		collPackages.clear();
	} else if (matchOption(opt[0], "compact", true)) {
	    compact = positive;
	} else if (matchOption(opt[0], "postfixpackage", true)) {
	    postfixPackage = positive;
	} else if (matchOption(opt[0], "link")) {
	    addApiDocRoots(opt[1]);
	} else if (matchOption(opt[0], "linkoffline")) {
	    addApiDocRootsOffline(opt[1], opt[2]);
	} else if(matchOption(opt[0], "contextPattern")) {
	    RelationDirection d; RelationType rt;
	    try {
		d = RelationDirection.valueOf(opt[2].toUpperCase());
		if(opt[1].equalsIgnoreCase("all")) {
		    contextRelationPattern = new RelationPattern(d);
		} else {
		    rt = RelationType.valueOf(opt[1].toUpperCase());
		    contextRelationPattern.addRelation(rt, d);
		}
	    } catch(IllegalArgumentException e) {
		
	    }
		
	} else if (matchOption(opt[0], "nodesep", true)) {
	    try {
		nodeSep = positive ? Double.parseDouble(opt[1]) : 0.25;
	    } catch (NumberFormatException e) {
		System.err.println("Skipping invalid nodesep " + opt[1]);
	    }
	} else if (matchOption(opt[0], "ranksep", true)) {
	    try {
		rankSep = positive ? Double.parseDouble(opt[1]) : 0.5;
	    } catch (NumberFormatException e) {
		System.err.println("Skipping invalid ranksep " + opt[1]);
	    }
	} else if (matchOption(opt[0], "dotexecutable")) {
	    dotExecutable = opt[1];
	} else
	    ; // Do nothing, javadoc will handle the option or complain, if needed.
    }
126571
private static void reset()
    {
        description = null;
        argName = null;
        longopt = null;
        type = String.class;
        required = false;
        numberOfArgs = Option.UNINITIALIZED;
        optionalArg = false;
        valuesep = (char) 0;
    }
67106
def __initialize_ui(self):
        

        self.Lines_Columns_label.setAlignment(Qt.AlignRight)
        self.Lines_Columns_label.setText(self.__Lines_Columns_label_default_text.format(1, 1))

        self.Languages_comboBox.setModel(self.__container.languages_model)

        # Signals / Slots.
        self.Languages_comboBox.currentIndexChanged.connect(self.__Languages_comboBox__currentIndexChanged)
43127
final function onFormInitialized() {
		parent::onFormInitialized();
		$this->addClass('df-google-font');
		df_fe_init($this, __CLASS__, df_asset_third_party('Select2/main.css'), [
			'dataSource' => df_url_frontend('df-google-font')
			,'value' => $this['value'] // 2015-12-07 It is the selected value.
		]);
	}
1067639
function setOption(objA, objB, nameB, targetObj) {
  let nameA = nameB.split('-');
  if (nameA.length > 1) {
    nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1);
    nameA = nameA.join('');
    targetObj[nameA] = objA[nameA] || objA[nameB] || objB[nameA] || objB[nameB];
  } else {
    targetObj[nameB] = objA[nameB] || objB[nameB];
  }
}
101990
def _set_option(self, name, value, allow_clear=False):
        """"""
        if not allow_clear:
            # Prevent clears if value was set
            try:
                current_value = self._get_option(name)
                if value is None and current_value is not None:
                    return
            except AttributeError:
                pass

        self.opts[name] = value