Prepare the arguments
331252
def _prep_ssh(
            self,
            tgt,
            fun,
            arg=(),
            timeout=None,
            tgt_type='glob',
            kwarg=None,
            **kwargs):
        '''
        
        '''
        opts = copy.deepcopy(self.opts)
        opts.update(kwargs)
        if timeout:
            opts['timeout'] = timeout
        arg = salt.utils.args.condition_input(arg, kwarg)
        opts['argv'] = [fun] + arg
        opts['selected_target_option'] = tgt_type
        opts['tgt'] = tgt
        opts['arg'] = arg
        return salt.client.ssh.SSH(opts)
778348
public function initializeArguments()
    {
        $this->registerArgument('value', 'string', 'The input value. If not given, the evaluated child nodes will be used', false, null);
        $this->registerArgument('mode', 'string', 'The case to apply, must be one of this\' CASE_* constants. Defaults to uppercase application', false, self::CASE_UPPER);
    }
136906
def prepare_args(self, args, kwargs):
        
        args, kwargs = super().prepare_args(args, kwargs)
        form_kwargs = self.get_form_kwargs()
        self.form = self.Form(**form_kwargs)
        return args, kwargs
659181
private function prepareCommandLine()
    {
        $this->commandLine->setExecutable($this->getPhp());
        //We are un-shifting arguments to the beginning of the command line because arguments should be at the end
        $this->commandLine->createArgument(true)->setValue($this->getCommand());
        $this->commandLine->createArgument(true)->setValue($this->getComposer());
        $commandLine = (string) $this->commandLine;
        //Creating new Commandline instance. It allows to handle subsequent calls correctly
        $this->commandLine = new Commandline();

        return $commandLine;
    }
197957
function Args() {
    if (argv._.length >= 1) {
        try {
            // Attempt to parse 1st argument as JSON string
            _.extend(this, JSON.parse(argv._[0]));
        } catch (err) {
            // Pass, we must be in the console so don't worry about it
        }
    }
}
693077
function prepArgs(args, name, event, defaults) {
  args = Array.from(args);

  var namespace = [name];
  if (!Array.isArray(event)) {
    event = event.split(delimiter);
  }

  namespace = namespace.concat(event);

  args.shift();//remove the event

  args.unshift(namespace);
  if (defaults) {
    args.push(defaults);
  }
  return args;
}
458512
function assertArguments(options, argnames) {
  if (!argnames) return;
  if (!options) throw new TypeError('missing arguments: ' + argnames);
  argnames.forEach(function (argname) {
    if (!options.hasOwnProperty(argname)) {
      throw new TypeError('missing argument: ' + argname);
    }
  });
}
1369847
def prepare(self):
        
        for s in self.get_all_sources():
            if s.missing():
                msg = "Source `%s' not found, needed by target `%s'."
                raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0]))
258623
def _build_arguments(self):
        
        self._parser.add_argument(
            '--clean',
            type=bool,
            required=False,
            default=False,
            help="clean up everything that was created by freight forwarder at the end."
        )

        self._parser.add_argument(
            '--configs',
            type=bool,
            required=False,
            default=False,
            help="Would you like to inject configuration files?"
        )

        self._parser.add_argument(
            '--test',
            type=bool,
            required=False,
            default=False,
            help="Run tests."
        )

        self._parser.add_argument(
            '-t', '--tag',
            required=False,
            type=six.text_type,
            action='append',
            help='list of tags applied to the image being exported. example: sh1hash'
        )

        self._parser.add_argument(
            '--use-cache',
            required=False,
            action='store_true',
            default=False,
            help='Allow build to use cached image layers.'
        )

        self._parser.add_argument(
            '--no-tagging-scheme',
            required=False,
            action='store_true',
            default=False,
            help='Turn off freight forwarders tagging scheme.'
        )

        self._parser.add_argument(
            '--no-validation',
            action="store_true",
            required=False,
            default=False,
            help='**UNSAFE**. The image will be built, NOT started, and pushed to the registry'
        )

        self._parser.add_argument(
            '-y',
            required=False,
            action='store_true',
            default=False,
            help='**UNSAFE**. Turn off `--no-validation` interaction during export'
        )
1022884
protected function prepare()
    {
        //Force passice mode if not specified
        $this->addOption('passive', true);

        //To make call on different files, we must retrieve the root and apply commands to the path
        $tmp = clone $this->getUrl();
        $tmp->path('');
        $this->addOption('url', $tmp->toString());
    }
425996
def _build_arguments(self):
        
        # TODO: add tests to confirm deployments
        self._parser.add_argument(
            '-t', '--tag',
            required=False,
            type=six.text_type,
            default=None,
            help='This tag will override image tag provided in the configuration file.'
        )

        self._parser.add_argument(
            '-e', '--env',
            required=False,
            type=six.text_type,
            action='append',
            default=None,
            help='environment variables to create in the container at run time.'
        )
999395
def prepare(args):
    
    from jcvi.utils.table import write_csv
    from jcvi.formats.base import write_file
    from jcvi.formats.fastq import guessoffset, readlen

    p = OptionParser(prepare.__doc__ + FastqNamings)
    p.add_option("--corr", default=False, action="store_true",
                 help="Extra parameters for corrected data [default: %default]")
    p.add_option("--norun", default=False, action="store_true",
                 help="Don't write `run.sh` script [default: %default]")
    p.add_option("--ploidy", default="2", choices=("1", "2"),
                 help="Ploidy [default: %default]")
    p.set_cpus()
    opts, args = p.parse_args(args)

    if len(args) < 1:
        sys.exit(not p.print_help())

    organism_name = args[0]
    project_name = "".join(x[0] for x in organism_name.split()).upper()
    fnames = sorted(glob("*.fastq*") if len(args) == 1 else args[1:])
    for x in fnames:
        assert op.exists(x), "File `{0}` not found.".format(x)

    groupheader = "group_name library_name file_name".split()
    libheader = "library_name project_name organism_name type paired "\
        "frag_size frag_stddev insert_size insert_stddev read_orientation "\
        "genomic_start genomic_end".split()
    groups_33 = []
    groups_64 = []
    libs = []
    for file_name in fnames:
        offset = guessoffset([file_name])
        group_name = op.basename(file_name).split(".")[0]
        library_name = "-".join(group_name.split("-")[:2])

        # Handle paired files and convert to wildcard
        if ".1." in file_name:
            file_name = file_name.replace(".1.", ".?.")
        elif ".2." in file_name:
            continue

        groupscontents = groups_64 if offset == 64 else groups_33
        groupscontents.append((group_name, library_name, file_name))
        if library_name not in libs:
            libs.append(library_name)

    libcontents = []
    for library_name in libs:
        L = Library(library_name)
        size = L.size
        stddev = L.stddev
        type = L.type
        paired = L.paired
        read_orientation = L.read_orientation

        size = size or ""
        stddev = stddev or ""
        frag_size = size if type == "fragment" else ""
        frag_stddev = stddev if type == "fragment" else ""
        insert_size = size if type != "fragment" else ""
        insert_stddev = stddev if type != "fragment" else ""
        genomic_start, genomic_end = "", ""
        libcontents.append((library_name, project_name, organism_name, type, \
            paired, frag_size, frag_stddev, insert_size, insert_stddev, \
            read_orientation, genomic_start, genomic_end))

    for groups, csvfile in ((groups_33, "in_groups_33.csv"), \
                            (groups_64, "in_groups_64.csv"), \
                            (groups_33 + groups_64, "in_groups.csv")):
        if not groups:
            continue
        write_csv(groupheader, groups, filename=csvfile, tee=True)
        logging.debug("`{0}` created (# of groups = {1}).".\
            format(csvfile, len(groups)))

    write_csv(libheader, libcontents, filename="in_libs.csv", tee=True)
    logging.debug("`in_libs.csv` created (# of libs = {0}).".\
        format(len(libcontents)))

    runfile = "run.sh"

    # ALLPATHS stalls on reads over 250bp <https://www.biostars.org/p/122091/>
    max_rd_len = max(readlen([f]) for f in fnames)
    extra = "CLOSE_UNIPATH_GAPS=False " if max_rd_len > 200 else ""
    if opts.corr:
        extra += "FE_NUM_CYCLES=1 EC_K=28 FE_QUAL_CEIL_RADIUS=0"
        extra += " REMOVE_DODGY_READS_FRAG=False FE_MAX_KMER_FREQ_TO_MARK=1"

    if not opts.norun:
        contents = ALLPATHSRUN.format(opts.ploidy, opts.cpus, extra)
        write_file(runfile, contents)
526309
def make_ready(self):
        """"""
        SCons.Taskmaster.OutOfDateTask.make_ready(self)
        if self.out_of_date and self.options.debug_explain:
            explanation = self.out_of_date[0].explain()
            if explanation:
                sys.stdout.write("scons: " + explanation)
485485
def args(self, *args, **kwargs):
        
        self._any_args = False
        self._arguments_rule.set_args(*args, **kwargs)
        return self
296927
function prepare(list, arg) {
		return list.map(function(config) {
			var item = {
					//  the function to call
					call: config.call,

					//  all configured arguments
					arguments: config.arguments,

					//  the calculated specificity
					specificity: config.arguments.map(function(argument, index) {
						var value = 'value' in argument,
							specificity = 0;

						//  if a argument not a variadic one and the value is specified
						if (argument.type !== '...' && index < arg.length) {
							++specificity;

							//  bonus points if the exact type matches (explicit by type)
							//  OR there is no default value (explicitly provided)
							if (Number(argument.type === type(arg[index], true) || isExtendOf(argument.type, arg[index]) || !value)) {
								++specificity;
							}

							//  extra bonus points if the type is explicity the same (in case of inheritance)
							if (new RegExp('^' + type(arg[index], true) + '!$').test(argument.type)){ 
								++specificity;
							}
						}

						return specificity;
					}).join(''),

					//  the parameters with which the `call` may be executed
					param: config.arguments.map(function(argument, index) {
						var result = {};

						result.name = argument.name;

						//  if a variadic type is encountered, the remainder of the given arguments becomes the value
						if (argument.type === '...') {
							result.value = arg.slice(index);
						}
						else if (index < arg.length && typeof arg[index] !== 'undefined' && arg[index] !== null) {
							result.value = arg[index];
						}
						else if ('value' in argument) {
							result.value = argument.value;
						}
						else if ('reference' in argument) {
							result.reference = argument.reference;
						}

						return result;
					})
				};

			return item;
		});
	}
85079
public function initializeArguments()
    {
        parent::initializeArguments();

        $this->registerTagAttribute('quality', 'int', 'Specifies the image quality for jpeg', false);
        $this->registerTagAttribute('greyscale', 'bool', 'Should be image be rendered as greyscale?', false);
        $this->registerTagAttribute('grayscale', 'bool', 'Should be image be rendered as greyscale?', false);
    }
634330
def build_args():
    """"""
    parser = argparse.ArgumentParser(description=DESCRIPTION, formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument('recipe', type=str, help="The recipe file to load and run.")
    parser.add_argument('-d', '--define', action="append", default=[], help="Set a free variable in the recipe")
    parser.add_argument('-l', '--loop', default=None, help="Loop over a free variable")
    parser.add_argument('-i', '--info', action='store_true', help="Lists out all the steps of that recipe, doesn't run the recipe steps")
    parser.add_argument('-a', '--archive', help="Archive the passed yaml recipe and do not run it")
    parser.add_argument('-c', '--config', default=None, help="A YAML config file with variable definitions")

    return parser