Retrieve output_cwl_keys from potentially nested input arguments.
170648
def _get_output_cwl_keys(fnargs):
    
    for d in utils.flatten(fnargs):
        if isinstance(d, dict) and d.get("output_cwl_keys"):
            return d["output_cwl_keys"]
    raise ValueError("Did not find output_cwl_keys in %s" % (pprint.pformat(fnargs)))
1356807
def get_context_arguments(self):
        """"""
        cargs = {}
        for context in self.__context_stack:
            cargs.update(context.context_arguments)
        return cargs
181414
function inputArgs (outs, pipe, taskKey) {
  var args = []
  var inputPipesOf = inputPipes.bind(null, pipe)

  function populateArg (inputPipe) {
    var index = inputPipe[2] || 0
    var value = outs[inputPipe[0]]

    args[index] = value
  }

  inputPipesOf(taskKey).forEach(populateArg)

  return args
}
1192051
def _get_args_contents(self):
        
        return ' '.join(
            '%s=%s' % (key, shlex_quote(str(self.args[key])))
            for key in self.args
        ) + ' '
1098400
def _collapse_to_cwl_record_single(data, want_attrs, input_files):
    
    out = {}
    for key in want_attrs:
        key_parts = key.split("__")
        out[key] = _to_cwl(tz.get_in(key_parts, data), input_files)
    return out
953007
def _merge_cwlinputs(items_by_key, input_order, parallel):
    
    items_by_key = _maybe_nest_bare_single(items_by_key, parallel)
    if parallel == "multi-combined":
        items_by_key, input_order = _concat_records(items_by_key, input_order)
    var_items = set([_item_count(items_by_key[tuple(k.split("__"))])
                     for (k, t) in input_order.items() if t == "var"])
    rec_items = set([_item_count(items_by_key[k]) for (k, t) in input_order.items() if t == "record"])
    if var_items:
        num_items = var_items
        if len(num_items) == 2 and 1 in num_items:
            num_items.remove(1)
            items_by_key_test = _check_for_single_nested(num_items.pop(), items_by_key, input_order)
            var_items = set([_item_count(items_by_key_test[tuple(k.split("__"))])
                             for (k, t) in input_order.items() if t == "var"])
            num_items = var_items
        assert len(num_items) == 1, "Non-consistent variable data counts in CWL input:\n%s" % \
            (pprint.pformat(items_by_key))
        items_by_key, num_items = _nest_vars_in_rec(var_items, rec_items, input_order, items_by_key, parallel)
    else:
        num_items = rec_items
        assert len(num_items) == 1, "Non-consistent record data counts in CWL input:\n%s" % \
            (pprint.pformat(items_by_key))
    target_items = num_items.pop()
    out = [{} for _ in range(target_items)]
    for (cwl_key, cwl_type) in input_order.items():
        if cwl_type == "var":
            cwl_key = tuple(cwl_key.split("__"))
        cur_vals = items_by_key[cwl_key]
        if _is_nested_single(cur_vals, target_items):
            cur_vals = [[x] for x in cur_vals[0]]
        for i, cur_val in enumerate(cur_vals):
            if isinstance(cwl_key, (list, tuple)):
                # nested batches with records
                if (parallel.startswith(("batch", "multi-parallel")) and
                      isinstance(out[i], (list, tuple))):
                    for j in range(len(out[i])):
                        out[i][j] = _update_nested(list(cwl_key), cur_val, out[i][j], allow_overwriting=True)
                else:
                    out[i] = _update_nested(list(cwl_key), cur_val, out[i], allow_overwriting=True)
            elif out[i] == {}:
                out[i] = cur_val
            else:
                # Handle single non-batched records
                if isinstance(cur_val, (list, tuple)) and len(cur_val) == 1:
                    cur_val = cur_val[0]
                assert isinstance(cur_val, dict), (cwl_key, cur_val)
                for k, v in cur_val.items():
                    out[i] = _update_nested([k], v, out[i], allow_overwriting=True)
    return out
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
1299704
def get_keys(self):
        
        return [(self.first_key + i) for i in range(0, len(self.targets))]
5075
def get_kws_plt(self):
        """"""
        kws_plt = {}
        for key_plt in self.keys_plt:
            key_val = getattr(self, key_plt, None)
            if key_val is not None:
                kws_plt[key_plt] = key_val
            elif key_plt in self.kws:
                kws_plt[key_plt] = self.kws[key_plt]
        return kws_plt
1156826
def get_args_tuple(args, kwargs, arg_names, kwargs_defaults):
    """"""
    args_list = list(args)
    args_len = len(args)
    all_args_len = len(arg_names)
    try:
        while args_len < all_args_len:
            arg_name = arg_names[args_len]
            if arg_name in kwargs_defaults:
                args_list.append(kwargs.get(arg_name, kwargs_defaults[arg_name]))
            else:
                args_list.append(kwargs[arg_name])
            args_len += 1
    except KeyError as e:
        raise TypeError("Missing argument %r" % (e.args[0],))
    return tuple(args_list)
993859
def keys(self):
        """"""
        keys = self._keys
        if keys is None:
            keys = tuple(self[i].name for i in self.key_indices)
        return keys
229769
def parse_from_args(self, l):
        """"""
        if self.multiple:
            return [self.parse_from_arg(arg) for arg in l]
        return self.parse_from_arg(l[0])
1128164
def get_kwargs(self):
        """"""
        return {k: v for k, v in vars(self).items() if k not in self._ignored}
917051
def _normalize_cwl_inputs(items):
    
    with_validate = {}
    vrn_files = []
    ready_items = []
    batch_samples = []
    for data in (cwlutils.normalize_missing(utils.to_single_data(d)) for d in items):
        batch_samples.append(dd.get_sample_name(data))
        if tz.get_in(["config", "algorithm", "validate"], data):
            with_validate[_checksum(tz.get_in(["config", "algorithm", "validate"], data))] = data
        if data.get("vrn_file"):
            vrn_files.append(data["vrn_file"])
        ready_items.append(data)
    if len(with_validate) == 0:
        data = _pick_lead_item(ready_items)
        data["batch_samples"] = batch_samples
        return data
    else:
        assert len(with_validate) == 1, len(with_validate)
        assert len(set(vrn_files)) == 1, set(vrn_files)
        data = _pick_lead_item(with_validate.values())
        data["batch_samples"] = batch_samples
        data["vrn_file"] = vrn_files[0]
        return data
893073
def _piped_input_cl(data, region, tmp_dir, out_base_file, prep_params):
    
    return data["work_bam"], _gatk_extract_reads_cl(data, region, prep_params, tmp_dir)
1361186
def commandlineargs(self):
        """"""
        commandlineargs = []
        for parametergroup, parameters in self.parameters: #pylint: disable=unused-variable
            for parameter in parameters:
                p = parameter.compilearg()
                if p:
                    commandlineargs.append(p)
        return " ".join(commandlineargs)
234631
def get_keys(self, lst):
        
        pk_name = self.get_pk_name()
        if self.is_pk_composite():
            return [[getattr(item, pk) for pk in pk_name] for item in lst]
        else:
            return [getattr(item, pk_name) for item in lst]