Initialize values, assumes called by node.js as script (e.g. - first parameter is /usr/bin/node)

@param  {Array}   args         A process.argv list of arguments
@return {Argr}                 Itself, chainable
17852
function(args) {
    var list = (typeof args === 'string') ? args.split(' ') : args;

    _command = _usedScript ? list[1] : list[0];

    // Reset
    _args = Array.prototype.slice.call(list, _usedScript ? 2 : 1);
    _data = null;

    if(_useStrict) {
      _data = _parse(_args);
    }

    return this;
  }
980247
function getArgs(args) {

  if (args.length === 0) {
    return [];
  }

  if (Array.isArray(args[0])) {
    return args[0];
  }

  return Array.prototype.slice.call(args);
}
966485
def init(args=None):
    """"""
    if args is None:
        args = []
    arr = (ctypes.c_char_p * len(args))()
    arr[:] = args
    _LIB.RabitInit(len(arr), arr)
249187
function _valuefyArgs(args, lib) {
    for (var i = 0; i < args.length; i++) {
        args[i] = _entityToValue(args[i], lib);
    }
}
929926
protected static Map<String, String> initializeSystemProperties(final String[] args) {
        final Map<String, String> result = new HashMap<>();
        final Pattern pattern = Pattern.compile("-D(.+)=(.+)");
        for (final String arg : args) {
            final Matcher matcher = pattern.matcher(arg);
            if (matcher.matches()) {
                final String key = matcher.group(1);
                final String value = matcher.group(2);
                result.put(key, value);
                System.setProperty(key, value);
            }
        }
        return result;
    }
607166
public void setArgs(String[] args) {
        if (args == null) {
            args = new String[]{};
        }
        this.args = args;
        this.argsList = Collections.unmodifiableList(new ArrayList<String>(Arrays.asList(args)));
    }
989975
function() {
            //add the proper number of arguments before adding remaining values
            if (!args.length) {
              args = Array(configs.length);
            }
            //fire callback with args and remaining values concatenated
            return callback.apply(null, args.concat(values));
          }
318236
function createArgs(args, color) {
  var last = args[args.length - 1];
  if (args.length > 1 && isObject(last && last.hash)) {
    args.pop();
  }
  if (typeof color === 'string' && utils[color]) {
    args[0] = utils[color](args[0]);
  }
  return args;
}
638124
def args(self, args):
        '''
        '''
        self._args = args
        self._logger.log('debug', 'Args set to {}'.format(args))
607734
def init_args():
    """"""
    parser = argparse.ArgumentParser(
        description='draw basic graphs on terminal')
    parser.add_argument(
        'filename',
        nargs='?',
        default="-",
        help='data file name (comma or space separated). Defaults to stdin.')
    parser.add_argument(
        '--title',
        help='Title of graph'
    )
    parser.add_argument(
        '--width',
        type=int,
        default=50,
        help='width of graph in characters default:50'
    )
    parser.add_argument(
        '--format',
        default='{:<5.2f}',
        help='format specifier to use.'
    )
    parser.add_argument(
        '--suffix',
        default='',
        help='string to add as a suffix to all data points.'
    )
    parser.add_argument(
        '--no-labels',
        action='store_true',
        help='Do not print the label column'
    )
    parser.add_argument(
        '--color',
        nargs='*',
        choices=AVAILABLE_COLORS,
        help='Graph bar color( s )'
    )
    parser.add_argument(
        '--vertical',
        action='store_true',
        help='Vertical graph'
    )
    parser.add_argument(
        '--stacked',
        action='store_true',
        help='Stacked bar graph'
    )
    parser.add_argument(
        '--different-scale',
        action='store_true',
        help='Categories have different scales.'
    )
    parser.add_argument(
        '--calendar',
        action='store_true',
        help='Calendar Heatmap chart'
    )
    parser.add_argument(
        '--start-dt',
        help='Start date for Calendar chart'
    )
    parser.add_argument(
        '--custom-tick',
        default='',
        help='Custom tick mark, emoji approved'
    )
    parser.add_argument(
        '--delim',
        default='',
        help='Custom delimiter, default , or space'
    )
    parser.add_argument(
        '--verbose',
        action='store_true',
        help='Verbose output, helpful for debugging'
    )
    parser.add_argument(
        '--version',
        action='store_true',
        help='Display version and exit'
    )
    if len(sys.argv) == 1:
        if sys.stdin.isatty():
            parser.print_usage()
            sys.exit(2)

    args = vars(parser.parse_args())

    if args['custom_tick'] != '':
        global TICK, SM_TICK
        TICK = args['custom_tick']
        SM_TICK = ''

    if args['delim'] != '':
        global DELIM
        DELIM = args['delim']

    return args
126860
function initNew (args) {
    // get module
    var module = this.component.module
    // if module has new method run it
    if (module.new) {
        // call new method with original new args
        this.promise = module.new(args.args).then(res => {
            // if new returns undefined do not set
            if (!defined(res)) {
                return
            }
            // require data to be object
            this.assert(typeof res === 'object' && res, 110)
            // if data is set then use it
            if (defined(res.data)) {
                // require data to be object
                this.assert(typeof res.data === 'object' && res.data, 110)
                // set component data to data returned by new method
                this.data = res.data
            }
            // if id set set it data use it
            if (defined(res.id)) {
                this.id = res.id
            }
        })
    }
    // otherwise set resolved promise
    else {
        // use any args for data
        _.merge(this.data, args.args)
        // set init promise as resolved
        this.promise = Promise.resolve()
    }
}
847637
function cli(args) {
    const { _: [command] } = args;
    return getModule(command).default(args)
        .catch(err => {
            getModule('input').emitError(err.message);
            process.exit(1);
        });
}
779143
function (args) {
    var i, val, akey, result = {};
    Object.keys(args).forEach(function (key) {
        val = args[key];
        if (Array.isArray(val)) {
            for (i = 0; i < val.length; i++) {
                akey = key + '[' + i + ']';
                result[akey] = val[i];
            }
        }
        else {
            result[key] = val;
        }
    });
    return result;
}
1053673
function argv(args) {
  var out = {directives: {}}
    , i = 0;

  /* istanbul ignore next: never use process.argv in tests */
  args = args || process.argv.slice(2);
  if(!args.length) return out;

  // read conf from stdin
  if(args[i] === STDIN) {
    out.stdin = true;
    i++;
  // conf should be first arg
  }else if(!PTN.test(args[i])) {
    out.file = args[i];
    i++;
  }

  function add(key, value) {
    if(!key || value === null) return;
    if(!out.directives[key]) {
      out.directives[key] = value;
    // handle repeated directives, create an array
    }else if(out.directives[key]
      && !Array.isArray(out.directives[key])){
      out.directives[key] = [out.directives[key]];
      out.directives[key].push(value)
    // append to existing array value
    }else{
      out.directives[key].push(value)
    }
  }

  function gobble(arg, key, value) {
    if(arg === undefined) return add(key, value);
    value = value || '';
    if(PTN.test(arg)) {
      key = arg.replace(PTN, '');
      // gobble up value arguments
      while((arg = args[i++]) !== undefined && !PTN.test(arg)) {
        if(value) value += ' ';
        value += arg;
      }
      if(PTN.test(arg)) i--;
      add(key, value);
      value = null;
    }else{
      if(value) value += ' ';
      value += arg;
    }
    gobble(args[i++], key, value);
  }
  gobble(args[i]);
  return out;
}
1134672
def init(arg):
    

    answers = {'a': 1}
    if arg == 'interactive':
        input("""Hi There!
    DataFlows will now bootstrap a data processing flow based on your needs.

    Press any key to start...
    """)

    elif arg == 'hello-world':
        raise NotImplementedError()
    else:
        url = arg
        answers = dict(
            input='remote',
            title=os.path.basename(url),
            input_url=url,
            processing=[],
            output='print_n_pkg'
        )
        extract_format(answers, url)

    questions = [
        # Input
        inquirer.List('input_str',
                    message='What is the source of your data?',
                    choices=INPUTS.keys(),
                    ignore=lambda ctx: ctx.get('input') is not None,
                    validate=convert_input),

        # Input Parameters
        inquirer.Text('input_url',
                    message="What is the path of that file",
                    ignore=fany(lambda ctx: ctx.get('input') != 'file',
                                lambda ctx: ctx.get('input_url') is not None),
                    validate=fall(not_empty, extract_format)),
        inquirer.List('format',
                    message="We couldn't detect the file format - which is it?",
                    choices=FORMATS[:-1],
                    ignore=fany(lambda ctx: ctx.get('input') != 'file',
                                lambda ctx: ctx.get('format') in FORMATS)),

        inquirer.Text('input_url',
                    message="Where is that file located (URL)",
                    ignore=fany(lambda ctx: ctx.get('input') != 'remote',
                                lambda ctx: ctx.get('input_url') is not None),
                    validate=fall(extract_format, not_empty, valid_url)),
        inquirer.List('format',
                      message="We couldn't detect the source format - which is it",
                      choices=FORMATS,
                      ignore=fany(lambda ctx: ctx['input'] != 'remote',
                                  lambda ctx: ctx.get('format') in FORMATS)
                      ),
        inquirer.Text('sheet',
                      message="Which sheet in the spreadsheet should be processed (name or index)",
                      validate=not_empty,
                      ignore=lambda ctx: ctx.get('format') not in ('xls', 'xlsx', 'ods'),
                      ),
        inquirer.Text('input_url',
                      message="What is the connection string to the database",
                      validate=not_empty,
                      ignore=fany(lambda ctx: ctx['input'] != 'sql',
                                  lambda ctx: ctx.get('input_url') is not None),
                      ),
        inquirer.Text('input_db_table',
                      message="...and the name of the database table to extract",
                      validate=not_empty,
                      ignore=fany(lambda ctx: ctx['input'] != 'sql',
                                  lambda ctx: ctx.get('input_db_table') is not None),
                      ),

        inquirer.Text('input_url',
                      message="Describe that other source (shortly)",
                      ignore=fany(lambda ctx: ctx['input'] != 'other',
                                  lambda ctx: ctx.get('input_url') is not None),
                      ),

        # Processing
        inquirer.Checkbox('processing_str',
                        message="What kind of processing would you like to run on the data",
                        choices=PROCESSING.keys(),
                        ignore=lambda ctx: ctx.get('processing') is not None,
                        validate=convert_processing),

        # Output
        inquirer.List('output_str',
                    message="Finally, where would you like the output data",
                    choices=OUTPUTS.keys(),
                    ignore=lambda ctx: ctx.get('output') is not None,
                    validate=convert_output),
        inquirer.Text('output_url',
                      message="What is the connection string to the database",
                      validate=not_empty,
                      ignore=fany(lambda ctx: ctx['output'] != 'sql',
                                  lambda ctx: ctx.get('output_url') is not None),
                      ),
        inquirer.Text('output_db_table',
                      message="...and the name of the database table to write to",
                      validate=not_empty,
                      ignore=fany(lambda ctx: ctx['output'] != 'sql',
                                  lambda ctx: ctx.get('output_db_table') is not None),
                      ),

        # # Finalize
        inquirer.Text('title',
                    message="That's it! Now, just provide a title for your processing flow",
                    ignore=lambda ctx: ctx.get('title') is not None,
                    validate=not_empty),
    ]
    answers = inquirer.prompt(questions, answers=answers, theme=themes.GreenPassion())
    if answers is None:
        return
    answers['slug'] = slugify.slugify(answers['title'], separator='_')

    filename = '{slug}.py'.format(**answers)
    with open(filename, 'w') as out:
        print('Writing processing code into {}'.format(filename))
        out.write(render(answers))

    try:
        print('Running {}'.format(filename))
        ret = subprocess.check_output('python '+filename,
                                      stderr=subprocess.PIPE, universal_newlines=True, shell=True)
        print(ret)
        print('Done!')
    except subprocess.CalledProcessError as e:
        print("Processing failed, here's the error:")
        print(e.stderr)
        answers = inquirer.prompt([
            inquirer.Confirm('edit',
                            message='Would you like to open {} in the default editor?'.format(filename),
                            default=False)
        ])
        if answers['edit']:
            click.edit(filename=filename)
179593
private void initMainParameterValue(String arg) {
        if (mainParameter == null) {
            throw new ParameterException(
                    "Was passed main parameter '" + arg + "' but no main parameter was defined in your arg class");
        }

        Object object = mainParameter.parameterized.get(mainParameter.object);
        Class<?> type = mainParameter.parameterized.getType();

        // If it's a List<String>, we might need to create that list and then add the value to it.
        if (List.class.isAssignableFrom(type)) {
            List result;
            if (object == null) {
                result = Lists.newArrayList();
            } else {
                result = (List) object;
            }

            if (mainParameter.firstTimeMainParameter) {
                result.clear();
                mainParameter.firstTimeMainParameter = false;
            }

            mainParameter.multipleValue = result;
            mainParameter.parameterized.set(mainParameter.object, result);
        }

    }
368594
private int init(String[] args) {
		try { // initialize file system handle
			fs = FileSystem.get(getConf());
		} catch (IOException ioe) {
			System.err.println("Can not initialize the file system: "
					+ ioe.getLocalizedMessage());
			return -1;
		}

		for (int i = 0; i < args.length; i++) { // parse command line
			if (args[i].equals("-root")) {
				root = new Path(args[++i]);
			} else if (args[i].equals("-inDir")) {
				inDir = new File(args[++i]);
			} else if (args[i].equals("-files"))
				nFiles = Integer.parseInt(args[++i]);
			else {
				System.err.println(USAGE);
				ToolRunner.printGenericCommandUsage(System.err);
				System.exit(-1);
			}
		}
		return 0;
	}