We need to regenerate optimist options if --help or -h is encountered
555430
function getOpts (processArgv) {
  return optimist(processArgv)
    .usage(help())
    // Show version
    .boolean("version")
    .describe("version", "Show version and exit")
    // Help options (converted to help command)
    .boolean("h")
    .describe("h", "Show help")
    .alias("h", "help")
    // Update notification control
    .boolean("no-notifier")
    .describe("no-notifier", "Disable update notifier");
}
673418
def fix_config(self, options):
        
        options = super(ClassifierErrors, self).fix_config(options)

        opt = "absolute"
        if opt not in options:
            options[opt] = True
        if opt not in self.help:
            self.help[opt] = "Whether to use absolute errors as size or relative ones (bool)."

        opt = "max_relative_size"
        if opt not in options:
            options[opt] = 50
        if opt not in self.help:
            self.help[opt] = "The maximum size in point in case of relative mode (int)."

        opt = "absolute_size"
        if opt not in options:
            options[opt] = 50
        if opt not in self.help:
            self.help[opt] = "The size in point in case of absolute mode (int)."

        opt = "title"
        if opt not in options:
            options[opt] = None
        if opt not in self.help:
            self.help[opt] = "The title for the plot (str)."

        opt = "outfile"
        if opt not in options:
            options[opt] = None
        if opt not in self.help:
            self.help[opt] = "The file to store the plot in (str)."

        opt = "wait"
        if opt not in options:
            options[opt] = True
        if opt not in self.help:
            self.help[opt] = "Whether to wait for user to close the plot window (bool)."

        return options
7809
function mergeOptions(...opt){
        // extract default (last argument)
        const result = opt.pop();

        // try to find first match
        while (opt.length > 0){
            // extract first argument (priority)
            const o = opt.shift();

            // value set ?
            if (typeof o !== 'undefined' && o !== null){
                return o;
            }
        }

        return result;
    }
1232166
def fix_config(self, options):
        
        options = super(FileSupplier, self).fix_config(options)

        opt = "files"
        if opt not in options:
            options[opt] = []
        if opt not in self.help:
            self.help[opt] = "The files to output (list of string)."

        return options
266834
def function_options_help():
    

    message = m.Message()
    message.add(m.Brand())
    message.add(heading())
    message.add(content())
    return message
763567
def options_policy(skip_invalid, warn_on_skip):
    
    settings = (Options.skip_invalid, Options.warn_on_skip)
    (Options.skip_invalid, Options.warn_on_skip) = (skip_invalid, warn_on_skip)
    yield
    (Options.skip_invalid, Options.warn_on_skip) = settings
445071
function resolveApps (opts) {
    const handler = strategies[opts.strategy];
    if (!handler) {
      throw Error('invalid suggestion strategy');
    }
    return handler(opts);
  }
416084
def fix_config(self, options):
        
        options = super(InitStorageValue, self).fix_config(options)

        opt = "storage_name"
        if opt not in options:
            options[opt] = "unknown"
        if opt not in self.help:
            self.help[opt] = "The name of the storage value to delete (string)."

        opt = "value"
        if opt not in options:
            options[opt] = "1"
        if opt not in self.help:
            self.help[opt] = "The initial value (string)."

        return options
82015
function(callback) {

				// if there’s anything to optimize…
				if (outputFiles.length > 0) {

					// get absolute paths to the stuff we’re optimizing
					var outputFilesResolved = outputFiles.map(function(dir) {
						return path.resolve(__dirname, '../' + dir);
					});

					// optimize as many times as the user wants
					async.timesSeries(options.optimize.output.imageOptim, function(i, next) {

						// let the user know that we’re optimizing inputs
						grunt.log.writeln('Optimizing outputs with ImageOptim (pass ' + (i + 1) + ' of ' + options.optimize.output.imageOptim + ')…');

						// do the optimizations (with promises)
						optimizeImageOptim(outputFilesResolved, binPath.imageOptim).then(function() {
							next();
						});

					}, callback);

				} else {
					callback(null);
				}

			}
1049277
def fix(h, i):
    """"""
    down(h, i, h.size())
    up(h, i)
54182
def fix_config(self, options):
        
        opt = "setup"
        if opt not in options:
            options[opt] = conversion.PassThrough()
        if opt not in self.help:
            self.help[opt] = "The conversion to apply to the input data (Conversion)."

        return super(Convert, self).fix_config(options)
869962
function opt(argv, arg, index, key) {
    var value = argv[index + 1], equals = arg.indexOf('=');
    if(equals > -1) {
      value = arg.substr(equals + 1);
    }
    if(value && ~keys.indexOf(value)) {
      return value;
    }
    if(arg === option[key]) {
      return modes[key];
    }
  }
299127
def default_help_formatter(quick_helps):
    
    ret = ''
    for line in quick_helps:
        cmd_path, param_hlp, cmd_hlp = line
        ret += ' '.join(cmd_path) + ' '
        if param_hlp:
            ret += param_hlp + ' '
        ret += '- ' + cmd_hlp + '\n'
    return ret
535602
private static void rewriteOptions(String[] args, String option, String new_option) {
        for (int i=0; i<args.length; ++i) {
            if (args[i].equals(option)) {
                args[i] = new_option;
            }
        }
    }
537748
def fix_config(self, options):
        
        opt = "setup"
        if opt not in options:
            options[opt] = datagen.DataGenerator(classname="weka.datagenerators.classifiers.classification.Agrawal")
        if opt not in self.help:
            self.help[opt] = "The data generator to use (DataGenerator)."

        opt = "incremental"
        if opt not in options:
            options[opt] = False
        if opt not in self.help:
            self.help[opt] = "Whether to output the data incrementally, in case the generator supports that (bool)."

        return super(DataGenerator, self).fix_config(options)
421358
def opt(self, x_init, f_fp=None, f=None, fp=None):
        
        rcstrings = ['','Maximum number of iterations exceeded', 'Gradient and/or function calls not changing']

        opt_dict = {}
        if self.xtol is not None:
            print("WARNING: bfgs doesn't have an xtol arg, so I'm going to ignore it")
        if self.ftol is not None:
            print("WARNING: bfgs doesn't have an ftol arg, so I'm going to ignore it")
        if self.gtol is not None:
            opt_dict['gtol'] = self.gtol

        opt_result = optimize.fmin_bfgs(f, x_init, fp, disp=self.messages,
                                            maxiter=self.max_iters, full_output=True, **opt_dict)
        self.x_opt = opt_result[0]
        self.f_opt = f_fp(self.x_opt)[0]
        self.funct_eval = opt_result[4]
        self.status = rcstrings[opt_result[6]]
611739
function transformHelpArgs (processArgv) {
  var args = (processArgv || []).slice();

  // Remove "--help" and "-h" from args
  var longIndex = args.indexOf("--help");
  if (longIndex !== -1) {
    args.splice(longIndex, 1);
  }
  var shortIndex = args.indexOf("-h");
  if (shortIndex !== -1) {
    args.splice(shortIndex, 1);
  }

  // Replace `$0 …` by `$0 help …`
  args.unshift("help");

  return args;
}