Retrieve input arguments of a task.

@param {Object} outs
@param {Object} pipe
@param {String} taskKey

@returns {Array} args
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
}
537890
function (arg) {
    var args = Array.isArray(arg) ? arg : [].slice.call(arguments);
    var channel = options.taskChannelPrefix + '.' + args[0];
    args[0] = channel;
    fs.write(tmpfile, JSON.stringify(args) + "\n", "a");
}
125011
function pipe() {
            for (var _len = arguments.length, channels = Array(_len), _key = 0; _key < _len; _key++) {
                channels[_key] = arguments[_key];
            }

            return Channel.pipe.apply(Channel, [this].concat(channels));
        }
404143
def extract_input(pipe_def=None, pipe_generator=None):
    """"""
    if pipe_def:
        pyinput = gen_input(pipe_def)
    elif pipe_generator:
        pyinput = pipe_generator(Context(describe_input=True))
    else:
        raise Exception('Must supply at least one kwarg!')

    return sorted(list(pyinput))
1339483
function chain(tasks) {
      return function() {
        var pipeline = fullPipeline();

        _.each(tasks, function(task) {
          pipeline = pipeline.pipe(task.callback(options)());
        });

        return pipeline;
      };
    }
891470
@Override
  public <T> void outPipe(HeadersAmp headers, 
                          PipePub<T> result,
                          StubAmp actor,
                          Object[] args)
  {
    result.fail(new UnsupportedOperationException(getClass().getName()));
  }
268837
function input (args, stream) {
  const list = Array.isArray(args) ? args : args.split(' ').filter(Boolean)
  const ports = list.map(Number).filter(num)

  if (ports.length || !stream) {
    return Promise.resolve(ports)
  }

  return stdin().then(s => input(s, false))
}
512725
function evalTasks (funcs, task) {
  /**
  * Evaluate a single task and inject it.
  *
  * @param {String} taskKey
  */

  function inject (taskKey) {
    var taskName = task[taskKey]

    try {
      var e = eval(taskName) // eslint-disable-line

      if (typeof e === 'function') {
        funcs[taskName] = e
      } else {
        funcs[taskName] = function () { return e }
      }
    } catch (err) {
      var msg = 'Task not compiled: ' + taskName + ' [' + taskKey + ']' + err
      throw new Error(msg)
    }
  }

  Object.keys(task)
    .filter(reserved(task))
    .filter(dflowDSL(task))
    .filter(alreadyDefined(funcs, task))
    .forEach(inject)
}
1211624
def get_args(stream_spec, overwrite_output=False):
    """"""
    nodes = get_stream_spec_nodes(stream_spec)
    args = []
    # TODO: group nodes together, e.g. `-i somefile -r somerate`.
    sorted_nodes, outgoing_edge_maps = topo_sort(nodes)
    input_nodes = [node for node in sorted_nodes if isinstance(node, InputNode)]
    output_nodes = [node for node in sorted_nodes if isinstance(node, OutputNode)]
    global_nodes = [node for node in sorted_nodes if isinstance(node, GlobalNode)]
    filter_nodes = [node for node in sorted_nodes if isinstance(node, FilterNode)]
    stream_name_map = {(node, None): str(i) for i, node in enumerate(input_nodes)}
    filter_arg = _get_filter_arg(filter_nodes, outgoing_edge_maps, stream_name_map)
    args += reduce(operator.add, [_get_input_args(node) for node in input_nodes])
    if filter_arg:
        args += ['-filter_complex', filter_arg]
    args += reduce(operator.add, [_get_output_args(node, stream_name_map) for node in output_nodes])
    args += reduce(operator.add, [_get_global_args(node) for node in global_nodes], [])
    if overwrite_output:
        args += ['-y']
    return args
233095
def pipe_output (pipeto, str)
      case str
      when String
        #str = str.split "\n"
        # okay
      when Array
        str = str.join "\n"
      end
      #pipeto = '/usr/sbin/sendmail -t'
      #pipeto = %q{mail -s "my title" rahul}
      if pipeto != nil  # i was taking pipeto from a hash, so checking
        proc = IO.popen(pipeto, "w+")
        proc.puts str
        proc.close_write
        proc.readlines
      end
    end
452892
private List<TInput> getInputs(final List<Integer> taskletIds) {

    final List<TInput> inputList = new ArrayList<>(taskletIds.size());

    for(final int taskletId : taskletIds) {
      inputList.add(taskletIdInputMap.get(taskletId));
    }

    return inputList;
  }
1077008
public synchronized void mapOutputLost(TaskAttemptID taskid,
                                         String errorMsg) throws IOException {
    TaskInProgress tip = tasks.get(taskid);
    if (tip != null) {
      tip.mapOutputLost(errorMsg);
    } else {
      LOG.warn("Unknown child with bad map output: "+taskid+". Ignored.");
    }
  }
478303
def getTaskHelp(_Task):
  
  """
  Ret = []

  for k in ['name', 'desc']:
    v = _Task.Config.get(k)

    if v is not None:
      Ret.append('%s: %s' % (k, v))

  Args = _Task.Args

  if Args:
    Ret.append('\nArgs:')

    for argName, Arg in Args.items():
      Ret.append('  %s: %s' % (argName, Arg.get('desc', Arg['type_str'])))

    Ret.append('')

  return '\n'.join(Ret).rstrip()
169247
def get_output_from_pipe(self, input_file):
        
        args = shlex.split(self.cmd)
        p = Popen(args, stdout=PIPE, stdin=PIPE)  # | grep es
        p.stdin.write(bytearray(input_file.encode("utf8")))  # echo test |
        return p.communicate()[0].decode("utf8")
676021
function parseVargs(vargs) {
    var inOutParamStr = vargs.shift() || '';
    // if next arg is object, shift it off as options
    var options = (vargs.length && typeof(vargs[0]) === 'object') ? vargs.shift() : { };
    var taskDefArr = vargs; // rest are for the tasks
    var defObj = {
      inOutParamStr: inOutParamStr,
      taskDefArr: taskDefArr,
      options: options
    };
    return defObj;
  }
1114482
def nf_step_to_process(step, out_handle):
    
    pprint.pprint(step)

    directives = []
    for req in step["task_definition"]["requirements"]:
        if req["requirement_type"] == "docker":
            directives.append("container '%s'" % req["value"])
        elif req["requirement_type"] == "cpu":
            directives.append("cpus %s" % req["value"])
        elif req["requirement_type"] == "memory":
            directives.append("memory '%s'" % req["value"])

    task_id = step["task_id"]
    directives = "\n  ".join(directives)
    inputs = "\n    ".join(nf_io_to_process(step["inputs"], step["task_definition"]["inputs"],
                                        step["scatter"]))
    outputs = "\n    ".join(nf_io_to_process(step["outputs"], step["task_definition"]["outputs"]))
    commandline = (step["task_definition"]["baseCommand"] + " " +
                   " ".join([nf_input_to_cl(i) for i in step["task_definition"]["inputs"]]))
    out_handle.write(_nf_process_tmpl.format(**locals()))
827640
def get_args(self):
        
        return [
            self.task_cls.__module__,
            self.task_cls.__name__,
            self.encode_list(self.task_params),
            self.encode_list(self.branches),
            self.encode_bool(self.auto_retry),
            self.encode_list(self.dashboard_data),
        ]