Update the flavor arg based on the settings API
979345
def get_build_flavor(settings_module, args):
    """"""
    known_flavors = listify(call_user_func(settings_module, 'known_flavors'))
    if args.flavor:
        if args.flavor not in known_flavors:
            raise ValueError('Unknown build flavor: {}'.format(args.flavor))
    else:
        args.flavor = call_user_func(settings_module, 'default_flavor')
        if args.flavor and args.flavor not in known_flavors:
            raise ValueError(
                'Unknown default build flavor: {}'.format(args.flavor))
1346385
def update(**kwargs):
    '''
    
    '''
    stdout = {}

    for mode in ('fetch', 'install'):
        err_ = {}
        ret = _wrapper(mode, err_=err_, **kwargs)
        if 'retcode' in err_ and err_['retcode'] != 0:
            return ret
        if 'stdout' in err_:
            stdout[mode] = err_['stdout']
    return '\n'.join(['{0}: {1}'.format(k, v) for (k, v) in six.iteritems(stdout)])
218570
def args_update(self):
        """"""
        for key, value in self._config_data.items():
            setattr(self._default_args, key, value)
160830
def init_and_get_conf(argv: list=None) -> Config:
    
    colorama.init()
    work_dir = os.path.abspath(os.curdir)
    project_root = search_for_parent_dir(work_dir,
                                         with_files=set([BUILD_PROJ_FILE]))
    parser = make_parser(find_project_config_file(project_root))
    settings_module = get_user_settings_module(project_root)
    call_user_func(settings_module, 'extend_cli', parser)
    argcomplete.autocomplete(parser)
    args = parser.parse(argv)
    get_build_flavor(settings_module, args)
    config = Config(args, project_root, work_dir, settings_module)
    config.common_conf = call_user_func(
        config.settings, 'get_common_config', config, args)
    config.flavor_conf = call_user_func(
        config.settings, 'get_flavored_config', config, args)
    call_user_func(config.settings, 'extend_config', config, args)
    if not args.no_policies:
        config.policies = listify(call_user_func(
            config.settings, 'get_policies', config))
    return config
775252
def _add_arg_java(self, key, value, mask=False):
        
        if isinstance(value, bool):
            value = int(value)
        self._data[key] = value
        self._args.append('{}{}={}'.format('-D', key, value))
        self._args_quoted.append(self.quote('{}{}={}'.format('-D', key, value)))
        if mask:
            value = 'x' * len(str(value))
        self._args_masked.append('{}{}={}'.format('-D', key, value))
877225
function applyDefaultValuesForOptionsArguments( options, def ) {
    Object.keys( options ).forEach( function ( cmdName ) {
        const
            cmdOpts = options[ cmdName ],
            defOpts = def[ cmdName ].opts;
        if ( defOpts ) {
            Object.keys( defOpts ).forEach( function ( defOptName ) {
                if ( cmdOpts[ defOptName ] ) return;
                const defOptValue = defOpts[ defOptName ];
                if ( countArgs( defOptValue ) > 0 ) {
                    cmdOpts[ defOptName ] = defOptValue.args;
                }
            } );
        }
    } );
}
1127561
def _set_command_line_arguments(self, args):
        
        Global.LOGGER.debug("setting command line arguments")

        if args.VERBOSE:
            Global.LOGGER.debug("verbose mode active")
            Global.CONFIG_MANAGER.log_level = logging.DEBUG
            Global.LOGGER_INSTANCE.reconfigure_log_level()

        if args.STATS > 0:
            Global.LOGGER.debug(f"stats requested every {args.STATS} seconds")
            Global.CONFIG_MANAGER.show_stats = True
            Global.CONFIG_MANAGER.stats_timeout = args.STATS

        if args.INTERVAL > 0:
            Global.LOGGER.debug(f"setting sleep interval to {args.INTERVAL} milliseconds")
            Global.CONFIG_MANAGER.sleep_interval = float(args.INTERVAL)/1000

        if args.TRACE:
            Global.LOGGER.debug("tracing mode active")
            Global.CONFIG_MANAGER.tracing_mode = True
            Global.CONFIG_MANAGER.log_level = logging.DEBUG
            Global.LOGGER_INSTANCE.reconfigure_log_level()

        if  args.MESSAGEINTERVAL is not None and args.MESSAGEINTERVAL > 0:
            Global.LOGGER.debug(f"setting message fetcher sleep interval to {args.MESSAGEINTERVAL/10} milliseconds")
            Global.CONFIG_MANAGER.message_fetcher_sleep_interval =  float(args.MESSAGEINTERVAL)/10000
            Global.CONFIG_MANAGER.fixed_message_fetcher_interval = True

        Global.LOGGER.debug(f"recipes to be parsed: {args.FILENAME}")
        Global.CONFIG_MANAGER.recipes = (args.FILENAME)
541356
def update_mt_arg(self, metatabfile):
        """"""
        o = MetapackCliMemo(self.args)
        o.set_mt_arg(metatabfile)
        return o
806150
def _add_default_arguments(parser):
    
    parser.add_argument('-c', '--config', action='store', dest='config',
                        help='Path to the configuration file')
    parser.add_argument('-f', '--foreground', action='store_true', dest='foreground',
                        help='Run the application interactively')
1166066
def updateSolutionTerminal(self):
        '''
        
        '''
        self.solution_terminal.vFunc   = ValueFunc(self.cFunc_terminal_,self.CRRA)
        self.solution_terminal.vPfunc  = MargValueFunc(self.cFunc_terminal_,self.CRRA)
        self.solution_terminal.vPPfunc = MargMargValueFunc(self.cFunc_terminal_,self.CRRA)
225154
def populate_args_level(schema, parser):
    """"""
    for key, value in schema['properties'].iteritems():
        if key == 'name':
            continue

        arg = '--%s' % key
        desc = value['description']

        if 'type' in value:
            if value['type'] == 'string':
                if 'enum' in value:
                    parser.add_argument(arg, help=desc, type=str,
                        choices=value['enum'])
                else:
                    parser.add_argument(arg, help=desc, type=str)
            elif value['type'] == 'number':
                parser.add_argument(arg, help=desc, type=float)
            elif value['type'] == 'integer':
                parser.add_argument(arg, help=desc, type=int)
            elif str(value['type']) == 'array':
                assert value['minItems'] == value['maxItems']

                if value['items']['type'] != 'number':
                    raise NotImplementedError("Only float arrays work")
                parser.add_argument(arg, help=desc, type=float,
                    nargs=value['maxItems'], metavar='N')
            elif value['type'] == 'object':
                #group = parser.add_argument_group(key, value['description'])
                #populate_args_level(value, group)
                pass
492359
def flavor_access_list(request, flavor=None):
    """"""
    return _nova.novaclient(request).flavor_access.list(flavor=flavor)
1098049
protected function defArgConfigure(): void
    {
        $this->createDefinition()
            ->setDescription('the command arg/opt config use defined configure, it like symfony console: argument define by position')
            ->addArgument('name', Input::ARG_REQUIRED, "description for the argument 'name'")
            ->addOption('yes', 'y', Input::OPT_BOOLEAN, "description for the option 'yes'")
            ->addOption('opt1', null, Input::OPT_REQUIRED, "description for the option 'opt1'");
    }
1344734
function(downloadUrl, manifestUrl, flavor) {
        return getManifest(manifestUrl)
            .then(function(manifest) {
                return {
                    desiredVersion: manifest.stable.replace('v', ''),
                    downloadUrl: downloadUrl,
                    manifestUrl: manifestUrl,
                    flavor: flavor
                }
            })
            .then(this.getVersion);
    }
109448
def _add_arg(self, key, value, mask=False):
        
        if self.lang == 'python':
            self._add_arg_python(key, value, mask)
        elif self.lang == 'java':
            self._add_arg_java(key, value, mask)
455982
def flavor_extra_set(request, flavor_id, metadata):
    """"""
    flavor = _nova.novaclient(request).flavors.get(flavor_id)
    if (not metadata):  # not a way to delete keys
        return None
    return flavor.set_keys(metadata)
401295
def add_custom_arg(self, custom_arg):
        
        if custom_arg.personalization is not None:
            try:
                personalization = \
                    self._personalizations[custom_arg.personalization]
                has_internal_personalization = True
            except IndexError:
                personalization = Personalization()
                has_internal_personalization = False
            if isinstance(custom_arg, dict):
                (k, v) = list(custom_arg.items())[0]
                personalization.add_custom_arg(CustomArg(k, v))
            else:
                personalization.add_custom_arg(custom_arg)

            if not has_internal_personalization:
                self.add_personalization(
                    personalization, index=custom_arg.personalization)
        else:
            if isinstance(custom_arg, dict):
                (k, v) = list(custom_arg.items())[0]
                self._custom_args = self._ensure_append(
                    CustomArg(k, v), self._custom_args)
            else:
                self._custom_args = self._ensure_append(
                    custom_arg, self._custom_args)