runs the task on every item in the array at once
173184
function(arr, iterator, callback) {
      callback = _doOnce(callback || noop);
      var amount = arr.length;

      if (!isArray(arr)) return callback();

      var completed = 0;
      doEach(arr, function(item) {
        iterator(item, doOnce(function(err) {
          if (err) {
            callback(err);
            callback = noop;
          } else {
            completed++;
            if (completed >= amount) callback(null);
          }
        }));
      });
    }
151975
def run(*tasks: Awaitable, loop: asyncio.AbstractEventLoop=asyncio.get_event_loop()):
    
    futures = [asyncio.ensure_future(task, loop=loop) for task in tasks]
    return loop.run_until_complete(asyncio.gather(*futures))
36711
function each(collection, iterator, context) {
  var i = 0;

  if ('array' === type(collection)) {
    for (; i < collection.length; i++) {
      if (false === iterator.call(context || iterator, collection[i], i, collection)) {
        return; // If false is returned by the callback we need to bail out.
      }
    }
  } else {
    for (i in collection) {
      if (hasOwn.call(collection, i)) {
        if (false === iterator.call(context || iterator, collection[i], i, collection)) {
          return; // If false is returned by the callback we need to bail out.
        }
      }
    }
  }
}
77825
function (each, done) {
    var self = this
      , tasks = [];
    Object.keys(this.extensions).forEach(function (type) {
      Object.keys(self.extensions[type]).forEach(function (id) {
        var plugin = self.extensions[type][id];
        tasks.push(function (next) {
          each(type, id, plugin, next);
        });
      });
    });
    async.parallel(tasks, done);
  }
2897
def do_running_tasks(self, arg):
        
        for task in asyncio.Task.all_tasks(loop=self.loop):
            _LOGGING.info(task)
989682
function each(collection, callback) {
        if (!collection) {
            return;
        }

        for (var i = 0, l = collection.length; i < l; i += 1) {
            callback(collection[i]);
        }
    }
1215439
function every(arr, cb, thisArg) {
  cb = makeIterator(cb, thisArg);
  var result = true;
  if (arr == null) {
    return result;
  }

  var len = arr.length;
  var i = -1;

  while (++i < len) {
    if (!cb(arr[i], i, arr)) {
      result = false;
      break;
    }
  }
  return result;
}
843414
def execute_tasks(tasks,template_path)
      
      if File.exists?(File.expand_path(File.join(template_path,'tasks.rb')))
        load File.expand_path(File.join(template_path,'tasks.rb'))
      end
       
      tasks.each{
        |task|
        
        puts 'Running Task: ' + task
        
        task = replace_tags(task);
        
        options = task.split(', ')
        action = options.slice!(0)
        
        if(Tasks.respond_to?(action))
          Tasks.send action, options.join(', ')
        else
          send action, options.join(', ')
        end
        
      }
                  
    end
912537
function forEach(array, itemCallback) {
  for (let i = 0, len = array.length; i < len; i++) {
    if (itemCallback) {
      itemCallback.call(array[i], array[i], i);
    }
  }
}
41421
function forEach(data, task, callback) {

		var wrapTask,
		    isArray,
		    subject,
		    test,
		    len,
		    i;

		isArray = Array.isArray(data);
		i = -1;

		if (isArray) {
			subject = data;

			wrapTask = function wrapTask(next) {
				task(subject[i], i, next);
			};
		} else {
			subject = Bound.Object.dissect(data);

			wrapTask = function wrapTask(next) {
				task(subject[i].value, subject[i].key, next);
			};
		}

		len = subject.length;
		test = function test() {
			return ++i < len;
		};

		return Blast.Collection.Function['while'](test, wrapTask, callback);
	}
1136309
def run_selected_clicked(self):
        """"""
        # get all selected rows
        rows = sorted(set(index.row() for index in
                          self.table.selectedIndexes()))
        self.enable_busy_cursor()
        # iterate over selected rows
        for row in rows:
            current_row = row
            item = self.table.item(current_row, 0)
            status_item = self.table.item(current_row, 1)
            self.run_task(item, status_item)
        self.disable_busy_cursor()
593469
def run(self, tasks=None, timeout=None):
        """"""
        timeout = self._timeout if timeout is None else timeout
        if self.async_running or self.loop.is_running():
            return self.wait_all_tasks_done(timeout)
        else:
            tasks = tasks or self.todo_tasks
            return self.loop.run_until_complete(asyncio.gather(*tasks, loop=self.loop))
1193454
async function run() {
  await benchmark(
    () => map(f => f(), createPromiseFuncs()),
    'Map (concurrency: 3)'
  );
  await benchmark(
    () => mapWithOptions(f => f(), { concurrency: 1 }, createPromiseFuncs()),
    'Map (concurrency: 1)'
  );
  await benchmark(
    () => mapSeries(f => f(), createPromiseFuncs()),
    'Map series'
  );
}
1143301
function every() {
        for (
          var args = slice.call(arguments, 0)
            , callback = args.pop()
            , length = args.length
            , i = 0;

          i < length;
          this.on(args[i++], callback)
        ){}

        return this;
      }
57766
def execute(self):
        

        with self._lock_c:
            self.count = 0
            self.numtasks = 0
            self.taskset = []
            self.results = {}
            self.totaltime = time.time()
            # Start all tasks
            for task in self.taskseq:
                self.taskset.append(task)
                self.numtasks += 1
                task.init_and_start(self)

        num_tasks = self.getNumTasks()
        # Wait on each task to clean up results
        while num_tasks > 0:

            self.check_state()

            for i in range(num_tasks):
                try:
                    try:
                        task = self.getTask(i)
                    except IndexError:
                        # A task got deleted from the set.  Jump back out
                        # to outer loop and repoll the number of tasks
                        break

                    #self.logger.debug("waiting on %s" % task)
                    res = task.wait(timeout=self.idletime)

                    #self.logger.debug("finished: %s" % task)
                    self.child_done(res, task)

                except TaskTimeout:
                    continue

                except Exception as e:
                    #self.logger.warning("Subtask propagated exception: %s" % str(e))
                    self.child_done(e, task)
                    continue

            # wait a bit and try again
            #self.ev_quit.wait(self.idletime)

            # re-get number of tasks, in case some were added or deleted
            num_tasks = self.getNumTasks()

        # Scan results for errors (exceptions) and raise the first one we find
        for key in self.results.keys():
            value = self.results[key]
            if isinstance(value, Exception):
                (count, task) = key
                self.logger.error("Child task %s terminated with exception: %s" % (
                    task.tag, str(value)))
                raise value

        # Return value of last child to complete
        return value
702228
def run(self, target, callback = None, name = None, complete = None, *args, **kargs):
        
        self.count_lock.acquire()
        if not self.workers:
            self.count_lock.release()
            self.add(name = name)
        else:
            self.count_lock.release()
        self.tasks.put((target, callback, name, complete, args, kargs))
594409
function Parallel () {
  var actions = Array.prototype.slice.call(arguments);
  var tasksLeft;

  function _Parallel() {}

  function start() {
    tasksLeft = actions.length;
  }

  function done() {
    if (--tasksLeft === 0) {
      _Parallel.finish();
    }
  }

  function wait(action) {
    action.on('finish.parallel', function() {
      action.on('finish.parallel', null);
      done();
    });
  }


  _Parallel.enter = function() {
    start();
    for(var i = 0, len = actions.length; i < len; ++i) {
      var a = actions[i];
      if (a.enter) {
        if (a.enter()) {
          wait(a);
        } else {
          done();
        }
      }
    }
  };

  _Parallel.exit = function() {
    start();
    for(var i = actions.length - 1; i >= 0; --i) {
      var a = actions[i];
      if (a.exit) {
        if (a.exit()) {
          wait(a);
        } else {
          done();
        }
      }
    }
  };

  _Parallel.clear = function() {
    for(var i = 0, len = actions.length; i < len; ++i) {
      var a = actions[i];
      a.clear && a.clear();
    }
  }

  _Parallel = Action(_Parallel);
  return _Parallel;
}