Map from the top-level arguments to the arguments provided to
        the indiviudal links
332271
def _map_arguments(self, input_dict):
        
        data = input_dict.get('data')
        comp = input_dict.get('comp')
        library = input_dict.get('library')
        models = input_dict.get('models')
        hpx_order = input_dict.get('hpx_order_fitting')
        dry_run = input_dict.get('dry_run', False)

        self._set_link('init-model', InitModel,
                       comp=comp, data=data,
                       library=library,
                       models=models,
                       hpx_order=hpx_order,
                       dry_run=dry_run)

        self._set_link('assemble-model', AssembleModel_SG,
                       comp=comp, data=data,
                       models=models)
225080
def getArguments(parser):
    ""
    args = parser.parse_args()
    if args.width <= 0:
        raise argparse.ArgumentError(args.width, 'The contour width must be a positive number.')
    return args
1192051
def _get_args_contents(self):
        
        return ' '.join(
            '%s=%s' % (key, shlex_quote(str(self.args[key])))
            for key in self.args
        ) + ' '
557497
public Map<SkbShellArgument, Object> getArgMap(SkbShellArgument[] arguments){
		Map<SkbShellArgument, Object> ret = new LinkedHashMap<SkbShellArgument, Object>();
		if(arguments!=null){
			for(Entry<String, String> entry : this.getArgMap().entrySet()){
				for(SkbShellArgument ssa : arguments){
					if(ssa.getKey().equals(entry.getKey())){
						switch(ssa.getType()){
							case Boolean:
								ret.put(ssa, Boolean.valueOf(entry.getValue()));
								break;
							case Double:
								ret.put(ssa, Double.valueOf(entry.getValue()));
								break;
							case Integer:
								ret.put(ssa, Integer.valueOf(entry.getValue()));
								break;
							case String:
								ret.put(ssa, entry.getValue());
								break;
							case ListString:
								String[] ar = StringUtils.split(entry.getValue(), ';');
								if(ar!=null){
									List<String> val = new ArrayList<>();
									for(String s : ar){
										val.add(s);
									}
									ret.put(ssa, val);
								}
								break;
							case ListInteger:
								String[] arInt = StringUtils.split(entry.getValue(), ';');
								if(arInt!=null){
									List<Integer> valInt = new ArrayList<>();
									for(String s : arInt){
										valInt.add(Integer.valueOf(s));
									}
									ret.put(ssa, valInt);
								}
								break;
							default:
								System.err.println("parser.getArgMap --> argument type not yet supported: " + ssa.getType());//TODO do not use syserr prints
								break;
						}
					}
				}
			}
		}
		return ret;
	}
488714
def get_argument_values(
    arg_defs,  # type: Union[Dict[str, GraphQLArgument], Dict]
    arg_asts,  # type: Optional[List[Argument]]
    variables=None,  # type: Optional[Dict[str, Union[List, Dict, int, float, bool, str, None]]]
):
    # type: (...) -> Dict[str, Any]
    """"""
    if not arg_defs:
        return {}

    if arg_asts:
        arg_ast_map = {
            arg.name.value: arg for arg in arg_asts
        }  # type: Dict[str, Argument]
    else:
        arg_ast_map = {}

    result = {}
    for name, arg_def in arg_defs.items():
        arg_type = arg_def.type
        arg_ast = arg_ast_map.get(name)
        if name not in arg_ast_map:
            if arg_def.default_value is not None:
                result[arg_def.out_name or name] = arg_def.default_value
                continue
            elif isinstance(arg_type, GraphQLNonNull):
                raise GraphQLError(
                    'Argument "{name}" of required type {arg_type}" was not provided.'.format(
                        name=name, arg_type=arg_type
                    ),
                    arg_asts,
                )
        elif isinstance(arg_ast.value, ast.Variable):  # type: ignore
            variable_name = arg_ast.value.name.value  # type: ignore
            if variables and variable_name in variables:
                result[arg_def.out_name or name] = variables[variable_name]
            elif arg_def.default_value is not None:
                result[arg_def.out_name or name] = arg_def.default_value
            elif isinstance(arg_type, GraphQLNonNull):
                raise GraphQLError(
                    'Argument "{name}" of required type {arg_type}" provided the variable "${variable_name}" which was not provided'.format(
                        name=name, arg_type=arg_type, variable_name=variable_name
                    ),
                    arg_asts,
                )
            continue

        else:
            value = value_from_ast(arg_ast.value, arg_type, variables)  # type: ignore
            if value is None:
                if arg_def.default_value is not None:
                    value = arg_def.default_value
                    result[arg_def.out_name or name] = value
            else:
                # We use out_name as the output name for the
                # dict if exists
                result[arg_def.out_name or name] = value

    return result
664370
def find_args(event, arg_type):
    """"""
    args = event.get('arguments', {})
    obj_tags = [arg for arg in args if arg['type'] == arg_type]
    if obj_tags:
        return [o['value']['@id'] for o in obj_tags]
    else:
        return []
641207
def link(args):
    
    from jcvi.apps.base import mkdir

    p = OptionParser(link.__doc__)
    p.add_option("--dir",
                 help="Place links in a subdirectory [default: %default]")
    opts, args = p.parse_args(args)

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

    meta, = args
    d = opts.dir
    if d:
        mkdir(d)

    fp = open(meta)
    cwd = op.dirname(get_abs_path(meta))
    for row in fp:
        source, target = row.split()
        source = op.join(cwd, source)
        if d:
            target = op.join(d, target)
        lnsf(source, target, log=True)
101542
def list_links(args = {})
      if args.empty?
        links
      else
        links.select { |link| link.match? args }
      end
    end
881277
def str_args(args):
    
    res = []
    for x in args:
        if isinstance(x, tuple) and len(x) == 2:
            key, value = x
            if value and str_arg(value):
                res += ["%s=%s" % (key, str_arg(value))]
        else:
            res += [str_arg(x)]
    return ', '.join(res)
467504
def get_args(node):
    """"""
    arg_roles = {}
    args = node.findall('arg') + \
        [node.find('arg1'), node.find('arg2'), node.find('arg3')]
    for arg in args:
        if arg is not None:
            id = arg.attrib.get('id')
            if id is not None:
                arg_roles[arg.attrib['role']] = (arg.attrib['id'], arg)
    # Now look at possible inevent links
    if node.find('features') is not None:
        inevents = node.findall('features/inevent')
        for inevent in inevents:
            if 'id' in inevent.attrib:
                arg_roles['inevent'] = (inevent.attrib['id'], inevent)

        ptms = node.findall('features/ptm') + node.findall('features/no-ptm')
        for ptm in ptms:
            if 'id' in inevent.attrib:
                arg_roles['ptm'] = (inevent.attrib['id'], ptm)

    # And also look for assoc-with links
    aw = node.find('assoc-with')
    if aw is not None:
        aw_id = aw.attrib['id']
        arg_roles['assoc-with'] = (aw_id, aw)
    return arg_roles
1268478
private void tryReplaceArguments(Scope scope) {
    // Find the number of parameters that can be accessed without using `arguments`.
    Node parametersList = NodeUtil.getFunctionParameters(scope.getRootNode());
    checkState(parametersList.isParamList(), parametersList);
    int numParameters = parametersList.getChildCount();

    // Determine the highest index that is used to make an access on `arguments`. By default, assume
    // that the value is the number of parameters to the function.
    int highestIndex = getHighestIndex(numParameters - 1);
    if (highestIndex < 0) {
      return;
    }

    ImmutableSortedMap<Integer, String> argNames =
        assembleParamNames(parametersList, highestIndex + 1);
    changeMethodSignature(argNames, parametersList);
    changeBody(argNames);
  }
319138
def args_as_tuple(self):
        """"""
        if "," in self.arguments["header-names"]:
            result = tuple(tools.to_list(self.arguments["header-names"]))
        else:
            result = (self.arguments["header-names"].strip('"'),)
        result = result + (self.arguments["match-type"],)
        if "," in self.arguments["key-list"]:
            result = result + tuple(
                tools.to_list(self.arguments["key-list"], unquote=False))
        else:
            result = result + (self.arguments["key-list"].strip('"'),)
        return result
469411
def _map_arguments(self, args):
        
        config_yaml = args['config']
        config_dict = load_yaml(config_yaml)

        dry_run = args.get('dry_run', False)

        data = config_dict.get('data')
        comp = config_dict.get('comp')
        library = config_dict.get('library')
        models = config_dict.get('models')
        scratch = config_dict.get('scratch')

        self._set_link('prepare', SplitAndBinChain,
                       comp=comp, data=data,
                       ft1file=config_dict.get('ft1file'),
                       hpx_order_ccube=config_dict.get('hpx_order_ccube'),
                       hpx_order_expcube=config_dict.get('hpx_order_expcube'),
                       scratch=scratch,
                       dry_run=dry_run)

        self._set_link('diffuse-comp', DiffuseCompChain,
                       comp=comp, data=data,
                       library=library,
                       make_xml=config_dict.get('make_diffuse_comp_xml', False),
                       outdir=config_dict.get('merged_gasmap_dir', 'merged_gasmap'),
                       dry_run=dry_run)

        self._set_link('catalog-comp', CatalogCompChain,
                       comp=comp, data=data,
                       library=library,
                       make_xml=config_dict.get('make_catalog_comp_xml', False),
                       nsrc=config_dict.get('catalog_nsrc', 500),
                       dry_run=dry_run)
        
        self._set_link('assemble-model', AssembleModelChain,
                       comp=comp, data=data,
                       library=library,
                       models=models,
                       hpx_order=config_dict.get('hpx_order_fitting'),
                       dry_run=dry_run)
1217767
def get_link_map(self, nslave):
        
        tree_map, parent_map = self.get_tree(nslave)
        ring_map = self.get_ring(tree_map, parent_map)
        rmap = {0 : 0}
        k = 0
        for i in range(nslave - 1):
            k = ring_map[k][1]
            rmap[k] = i + 1

        ring_map_ = {}
        tree_map_ = {}
        parent_map_ ={}
        for k, v in ring_map.items():
            ring_map_[rmap[k]] = (rmap[v[0]], rmap[v[1]])
        for k, v in tree_map.items():
            tree_map_[rmap[k]] = [rmap[x] for x in v]
        for k, v in parent_map.items():
            if k != 0:
                parent_map_[rmap[k]] = rmap[v]
            else:
                parent_map_[rmap[k]] = -1
        return tree_map_, parent_map_, ring_map_
114233
def convert_arguments(value):
    """"""
    if isinstance(value, (list, tuple)):
        return [
            CommandLineBinding(**item) if isinstance(item, dict) else item
            for item in value
        ]
    return shlex.split(value)
788977
def argstostr(self):
        ""
        self.args = dict((k, self._tostr(v)) for k,v in self.args.items())
        return self.args
780145
def getArguments(parser):
    ""
    args = parser.parse_args()
    # parse volume and adapt to zero-indexing
    try:
        def _to_int_or_none(string):
            if 0 == len(string): return None
            return int(string)
        def _to_int_or_none_double (string):
            if 0 == len(string): return [None, None]
            return list(map(_to_int_or_none, string.split(':')))        
        args.volume = list(map(_to_int_or_none_double, args.volume.split(',')))
        args.volume = [(x[0], x[1]) for x in args.volume]
    except (ValueError, IndexError) as e:
        raise ArgumentError('Maleformed volume parameter "{}", see description with -h flag.'.format(args.volume), e)

    return args