Build the options from the config object.
511239
def get_options(config=None):
    """"""
    if config is None:
        from . import config
        config.get = lambda key, default=None: getattr(config, key, default)

    base = {
        "components": config.get("COMPONENTS"),
        "signatures": config.get("SIGNATURES"),
        "commit_msg_template": config.get("COMMIT_MSG_TEMPLATE"),
        "commit_msg_labels": config.get("COMMIT_MSG_LABELS"),
        "alt_signatures": config.get("ALT_SIGNATURES"),
        "trusted": config.get("TRUSTED_DEVELOPERS"),
        "pep8": config.get("CHECK_PEP8", True),
        "pydocstyle": config.get("CHECK_PYDOCSTYLE", True),
        "license": config.get("CHECK_LICENSE", True),
        "pyflakes": config.get("CHECK_PYFLAKES", True),
        "ignore": config.get("IGNORE"),
        "select": config.get("SELECT"),
        "match": config.get("PYDOCSTYLE_MATCH"),
        "match_dir": config.get("PYDOCSTYLE_MATCH_DIR"),
        "min_reviewers": config.get("MIN_REVIEWERS"),
        "colors": config.get("COLORS", True),
        "excludes": config.get("EXCLUDES", []),
        "authors": config.get("AUTHORS"),
        "exclude_author_names": config.get("EXCLUDE_AUTHOR_NAMES"),
    }
    options = {}
    for k, v in base.items():
        if v is not None:
            options[k] = v
    return options
8195
def config(self):
        """"""
        return ", ".join('%s:%s' % (key, value) for key, value in self.conf.items())
1099662
def setup(self, options=None, extractor=None):
        
        # Get our programmatic options
        self._util.use_options(options, extractor)

        # Overwrite non defaults in self.values with values from config
        self._util.use_config_file()
546889
public function build()
    {
        $options = $this->suppliedOptions;

        //set the title if it doesn't exist
        $options['title'] = $this->validator->arrayGet($options, 'title', $options['field_name']);

        //run the visible property closure if supplied
        $visible = $this->validator->arrayGet($options, 'visible');

        if (is_callable($visible)) {
            $options['visible'] = $visible($this->config->getDataModel()) ? true : false;
        }

        //run the editable property's closure if supplied
        $editable = $this->validator->arrayGet($options, 'editable');

        if (isset($editable) && is_callable($editable)) {
            $options['editable'] = $editable($this->config->getDataModel());
        }

        $this->suppliedOptions = $options;
    }
672647
def _get_options(raw_options, apply_config):
    """"""
    if not raw_options:
        return parse_args([''], apply_config=apply_config)

    if isinstance(raw_options, dict):
        options = parse_args([''], apply_config=apply_config)
        for name, value in raw_options.items():
            if not hasattr(options, name):
                raise ValueError("No such option '{}'".format(name))

            # Check for very basic type errors.
            expected_type = type(getattr(options, name))
            if not isinstance(expected_type, (str, unicode)):
                if isinstance(value, (str, unicode)):
                    raise ValueError(
                        "Option '{}' should not be a string".format(name))
            setattr(options, name, value)
    else:
        options = raw_options

    return options
257829
def CreateConfigHBuilder(env):
    """"""
    action = SCons.Action.Action(_createConfigH,
                                 _stringConfigH)
    sconfigHBld = SCons.Builder.Builder(action=action)
    env.Append( BUILDERS={'SConfigHBuilder':sconfigHBld} )
    for k in list(_ac_config_hs.keys()):
        env.SConfigHBuilder(k, env.Value(_ac_config_hs[k]))
1356014
def config_to_options(config):
    
    class Options:
        host=config.get('smtp', 'host', raw=True)
        port=config.getint('smtp', 'port')
        to_addr=config.get('mail', 'to_addr', raw=True)
        from_addr=config.get('mail', 'from_addr', raw=True)
        subject=config.get('mail', 'subject', raw=True)
        encoding=config.get('mail', 'encoding', raw=True)
        username=config.get('auth', 'username')
    opts = Options()
    # format
    opts.from_addr % {'host': opts.host, 'prog': 'notify'}
    opts.to_addr % {'host': opts.host, 'prog': 'notify'}
    return opts
781648
public function build()
    {
        parent::build();

        $value = $this->validator->arrayGet($this->suppliedOptions, 'value', true);

        //we need to set the value to 'false' when it is falsey so it plays nicely with select2
        if (!$value && $value !== '') {
            $this->suppliedOptions['value'] = 'false';
        }
    }
1180941
function config(options) {
    var current = config.current
    Object.assign(current, options)
    api._init(current)
}
1226149
def process_options(opts, config)
      options.each do |option|
        opts.on(*option.for_option_parser) do |x|
          config[map[option]] = x
        end
      end
    end
765393
def _config_options(func):
    
    for param in SHConfig().get_params()[-1::-1]:
        func = click.option('--{}'.format(param), param,
                            help='Set new values to configuration parameter "{}"'.format(param))(func)
    return func
78626
def parse_options(settings):
    ''''''
    optlist, args = getopt(sys.argv, 'x', [])
    settings['configfile'] = args[1]
    return settings
480809
protected function buildOptions()
    {
        $created = '';

        foreach($this->getOptions() as $key => $value){

            if ($key === 'class') {
                $value = $this->buildClassString($value);
            }

            $created .= "$key='$value' ";
        }

        return rtrim($created, ' ');
    }
192450
function buildConfig (_config) {
  _config.datastore = Object.assign({}, defaultDatastore, _get(_config, 'datastore', {}))

  return _config
}
702985
def build_option_parser(parser):
    """"""
    parser.add_argument(
        "--os-data-processing-api-version",
        metavar="<data-processing-api-version>",
        default=utils.env(
            'OS_DATA_PROCESSING_API_VERSION',
            default=DEFAULT_DATA_PROCESSING_API_VERSION),
        help=("Data processing API version, default=" +
              DEFAULT_DATA_PROCESSING_API_VERSION +
              ' (Env: OS_DATA_PROCESSING_API_VERSION)'))
    parser.add_argument(
        "--os-data-processing-url",
        default=utils.env(
            "OS_DATA_PROCESSING_URL"),
        help=("Data processing API URL, "
              "(Env: OS_DATA_PROCESSING_API_URL)"))
    return parser
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)
1243545
def _create_run_config(options):
        """"""
        values = {opt: getattr(options, opt) for opt in
                       RunConfiguration._fields}
        return RunConfiguration(**values)