Init the main parameter with the given arg. Note that the main parameter can be either a List<String>
or a single value.
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);
        }

    }
66090
def _init_params(self, inputs, overwrite=False):
        """"""
        inputs = [x if isinstance(x, DataDesc) else DataDesc(*x) for x in inputs]
        input_shapes = {item.name: item.shape for item in inputs}
        arg_shapes, _, aux_shapes = self.symbol.infer_shape(**input_shapes)
        assert arg_shapes is not None
        input_dtypes = {item.name: item.dtype for item in inputs}
        arg_dtypes, _, aux_dtypes = self.symbol.infer_type(**input_dtypes)
        assert arg_dtypes is not None

        arg_names = self.symbol.list_arguments()
        input_names = input_shapes.keys()
        param_names = [key for key in arg_names if key not in input_names]
        aux_names = self.symbol.list_auxiliary_states()

        param_name_attrs = [x for x in zip(arg_names, arg_shapes, arg_dtypes)
                            if x[0] in param_names]
        arg_params = {k : nd.zeros(shape=s, dtype=t)
                      for k, s, t in param_name_attrs}
        aux_name_attrs = [x for x in zip(aux_names, aux_shapes, aux_dtypes)
                          if x[0] in aux_names]
        aux_params = {k : nd.zeros(shape=s, dtype=t)
                      for k, s, t in aux_name_attrs}

        for k, v in arg_params.items():
            if self.arg_params and k in self.arg_params and (not overwrite):
                arg_params[k][:] = self.arg_params[k][:]
            else:
                self.initializer(k, v)

        for k, v in aux_params.items():
            if self.aux_params and k in self.aux_params and (not overwrite):
                aux_params[k][:] = self.aux_params[k][:]
            else:
                self.initializer(k, v)

        self.arg_params = arg_params
        self.aux_params = aux_params
        return (arg_names, list(param_names), aux_names)
318296
private void initStandAlone(String[] args) {
        if (m_bInitialized) {
            m_logger.warn("initStandAlone: Already initialized -- ignoring");
            return;
        }
        m_logger.info("Initializing standalone mode");
        initConfig(args);
        initStandaAloneServices();
        RESTService.instance().registerCommands(CMD_CLASSES);
        m_bInitialized = true;
    }
949937
public void init()
    {
        ServletContext config=getServletContext();
        _servletHandler=((ServletHandler.Context)config).getServletHandler();

        Enumeration e = getInitParameterNames();
        while(e.hasMoreElements())
        {
            String param=(String)e.nextElement();
            String value=getInitParameter(param);
            String lvalue=value.toLowerCase();
            if ("nonContextServlets".equals(param))
            {
                _nonContextServlets=value.length()>0 && lvalue.startsWith("t");
            }
            if ("verbose".equals(param))
            {
                _verbose=value.length()>0 && lvalue.startsWith("t");
            }
            else
            {
                if (_parameters==null)
                    _parameters=new HashMap();
                _parameters.put(param,value);
            }
        }
    }
364606
def __init_run(self, args, kwargs, extra_parameter_errors):
        """"""
        assert not self.active()
        self.__args = list(args)
        self.__kwargs = dict(kwargs)
        self.__extra_parameter_errors = extra_parameter_errors
        self.__args_count = len(args) + len(kwargs)
        self.__params_with_arguments = set()
        self.__stack = []
        self.__push_frame(None)
1312125
private void init(final String commandName, final String... arguments) {
        if (arguments != null) {
            if (arguments.length == 1) {
                init(commandName, arguments[0]);
                return;
            }

            String[] ary = new String[arguments.length];

            for (int i = 0; i < arguments.length; i++) {
                if (arguments[i].indexOf('!') == -1) {
                    ary[i] = arguments[i];
                } else {
                    ary[i] = "'" + arguments[i] + "'";
                }
            }
            // sCommandBytes = StringUtils.join(ary, '!');
            init(commandName, StringUtils.join(ary, '!'));
        } else {
            init(commandName, (String) null);
        }
    }
498263
private void init(Set<String> pCommands, String ... pArgs) {
        quiet = options.containsKey("quiet");
        verbose = options.containsKey("verbose");
        jarFile = lookupJarFile();

        // Special cases first
        extraArgs = checkCommandAndArgs(pCommands, pArgs);
    }
1241392
def init(parser = None):
    

    global p,subparsers
    if parser is None:
        p = argparse.ArgumentParser()
    else:
        p = parser

    arg = p.add_argument

    subparsers = p.add_subparsers()
1068751
def postinit(self, args, body):
        
        self.args = args
        self.body = body
397672
public static void main(String[] args) {
    for (int i = 0; i < args.length; i++) {
      String str = args[i];
      System.out.println(Interner.globalIntern(str) == str);
    }
  }
676920
public String[] init(String[] argv, int min, int max,
                       Collection<CommandLineParser.Option> options)
    throws IOException, SAXException {
    // parse command line
    parser = new CommandLineParser();
    parser.setMinimumArguments(min);
    parser.setMaximumArguments(max);
    parser.registerOption(new CommandLineParser.BooleanOption("reindex", 'I'));
    if (options != null)
      for (CommandLineParser.Option option : options)
        parser.registerOption(option);

    try {
      argv = parser.parse(argv);
    } catch (CommandLineParser.CommandLineParserException e) {
      System.err.println("ERROR: " + e.getMessage());
      usage();
      System.exit(1);
    }

    // do we need to reindex?
    boolean reindex = parser.getOptionState("reindex");

    // load configuration
    config = ConfigLoader.load(argv[0]);
    database = config.getDatabase(reindex); // overwrite iff reindex
    if (database.isInMemory())
      reindex = true; // no other way to do it in this case

    // reindex, if requested
    if (reindex)
      reindex(config, database);

    return argv;
  }
881569
def run(self, *args):
        
        params = self.parser.parse_args(args)

        code = self.initialize(name=params.name, reuse=params.reuse)

        return code
866341
function init (args) {
    // get values from args
    this.model = args.model
    this.promise = args.promise
    this.raw = args.raw
    this.session = args.session
    // list of instance properties
    this.properties = []
    // add default properties to instance
    _.each(this.model.defaultColumns, (defaultName, columnName) => {
        // skip row (n)um column
        if (columnName === 'c' || columnName === 'n') {
            return
        }
        // use d column to set deleted flag
        if (columnName === 'd') {
            this.isDeleted = this.raw[columnName] === 1 ? true : false
        }
        // and column to instance
        else {
            // add property using default name (e.g. id, createTime) to object
            this[defaultName] = this.raw[columnName]
            // add to properties
            this.properties.push(defaultName)
        }
    })
    // if model has data then make sure extra columns are set in data
    if (defined(this.model.columnName('data'))) {
        // check that extra properties defined in data
        _.each(this.model.extraColumns, (spec, columnName) => {
            // if extra property is in column but not data then set in data
            if (defined(this.raw[columnName]) && !defined(_.get(this.data, spec.path))) {
                // convert boolean
                if (spec.type === 'boolean') {
                    _.set(this.data, spec.path, this.raw[columnName] === 1 ? true : false)
                }
                // convert int
                else if (spec.type === 'int' || spec.type === 'smallint') {
                    var val = parseInt(this.raw[columnName])
                    // set value only if valid integer
                    if (!Number.isNaN(val)) {
                        _.set(this.data, spec.path, val)
                    }
                }
                // set all other values directly
                else {
                    _.set(this.data, spec.path, this.raw[columnName])
                }
            }
        })
    }
    // if model does not have data then any extra columns go on instance
    else {
        // add extra properties to instance
        _.each(this.model.extraColumns, (spec, columnName) => {
            this[columnName] = this.raw[columnName]
            // add to properties
            this.properties.push(columnName)
        })
    }
    // list of states record is in for checking access
    var states = []
    // add deleted to states if set
    if (this.isDeleted) {
        states.push('deleted')
    }
    // if there are reladed records loaded copy them to instance
    if (this.raw._related) {
        this.related = this.raw._related
        delete this.raw._related
    }
    // if child id was selected use to determin if record is current
    if (this.raw.hasOwnProperty('childId')) {
        // if record has child it is not current
        this.isCurrent = defined(this.raw.childId) ? false : true
        // add isCurrent to properties
        this.properties.push('isCurrent')
    }
    // default scope for access control
    this.scope = 'any'
    // id that grants ownership access to record
    this.accessId = undefined
    // set access id for raw if defined
    if (defined(this.raw[this.model.accessIdName])) {
        this.accessId = this.raw[this.model.accessIdName]
    }
    // otherwise set from data - may be undefined
    else if (defined(this.data) && defined(this.data[this.model.accessIdName])) {
        this.accessId = this.data[this.model.accessIdName]
    }
    // if session has accessId set and it is used for model then use it
    if (defined(this.session.accessId) && this.session.accessIdName === this.model.accessIdName) {
        // if access id is in data and matches session then change scope to own
        if (this.session.accessId = this.accessId) {
            this.scope = 'own'
        }
    }
    // otherwise try account id
    else if (defined(this.session.accountId) && this.model.defaultColumnsInverse.accountId) {
        // if account id matches session then change scope to own
        if (this.session.accountId === this.accountId) {
            this.scope = 'own'
        }
    }
    // check access unless allow override set - only check access on primary model
    // records and not on action records
    if (!args.allow && !this.model.isAction) {
        // get global access control instance
        var accessControl = ImmutableAccessControl.getGlobal()
        // build args for access check - default to any scope
        var allowArgs = {
            action: 'read',
            model: this.model.name,
            scope: this.scope,
            session: this.session,
            states: states,
        }
        // check access
        var allow = accessControl.allowModel(allowArgs)
        // throw access denied error if not allowed
        if (!allow) {
            httpError(403, null, accessControl.audit)
        }
    }
}
206192
public void setArg(int index,String arg){
        if(args==null){
            args = new String[index];
        }else if(args.length<index){
            String[] newArgs  = new String[index];
            System.arraycopy(args,0,newArgs,0,args.length);
            args = newArgs;
        }
        args[index-1]=arg;
    }
361921
public static void main(String[] args) {

    try {
      MnistDAO.init("/usr/local/Datasets"); // setup data
    System.out.println("here");
      MnistImageDisplayApp mnistImageDisplayApp = new MnistImageDisplayApp();
      mnistImageDisplayApp.go(args);
    } catch (Exception e) {
      // eat it.
    } finally {
      MnistDAO.release(); // release data resources
    }

  }
137253
public static void main(String[] args) throws Throwable {
        String homeDir = getHomeDir(args);
        System.setProperty(TRACE_PARSER_HOME, homeDir);
        String dataDir = homeDir + File.separator + "data" + File.separator;
        System.setProperty(TRACE_PARSER_DATA, dataDir);

        if (!initLOG4JProperties(homeDir) && !initLOG4JXml(homeDir)) {
            logger.error("Failed to initialize loggin, no configuration. Defaults are used.");
        }

        logger.info("log4j configured");

        Ss7ParseParameters par = null;
        String persistDir = homeDir + File.separator + "data";
        try {
            BufferedInputStream bis = new BufferedInputStream(new FileInputStream(persistDir + File.separator + "Ss7ParseParameters.xml"));
            XMLDecoder d = new XMLDecoder(bis);
            par = (Ss7ParseParameters) d.readObject();
            d.close();
        } catch (Exception e) {
            // we ignore exceptions
        }

        Main main = new Main();

//        main.processCommandLine(args);
        main.boot(persistDir, par);
    }
460808
public static void main(String[] args)
    {
        Class<?> exampleClass = args.length > 0 ? EXAMPLES.get(args[0]) : null;
        if (exampleClass == null)
        {
            System.err.println("First argument must be the name of an example, i.e. one of "
                               + Arrays.toString(EXAMPLES.keySet().toArray()));
            System.exit(1);
        }

        // All args except the first one should be passed to the example application.
        String[] appArgs = new String[args.length - 1];
        System.arraycopy(args, 1, appArgs, 0, appArgs.length);

        // Invoke the main method for the selected example application.
        Method main = ReflectionUtils.findKnownMethod(exampleClass, "main", String[].class);
        ReflectionUtils.invokeUnchecked(main, exampleClass, new Object[]{appArgs});
    }