Perform a function on every item in an iterable.
547474
def map(self):
        """"""
        with Pool(self.cpu_count) as pool:
            pool.map(self._func, self._iterable)
            pool.close()
        return True
136679
function each(items, numParralel, fn, done) {
    if (done === undefined) {
      done = fn; fn = numParralel;
      numParralel = 3;
    }

    if (numParralel <= 0) numParralel = 1;

    let doing = 0;
    let numProcessing = 0;
    let numDone = 0;
    const numTotal = items.length;
    const results = [];
    return nextItem();

    function nextItem() {
      // We done-check first in case of emtpty array
      if (numDone >= numTotal) return done(null, results);

      // Batch (or call next item)
      while (doing < numTotal && numProcessing < numParralel) {
        callFn(fn, items[doing++], onDone);
        numProcessing++;
      }
      return;

      // All done
      function onDone(err, result) {
        if (err) return done(err);

        results.push(result);
        numProcessing--;
        numDone++;
        return nextItem();
      }
    }
  }
229771
def iterate(it):
    """"""
    if is_async_iterable(it):
        return from_async_iterable.raw(it)
    if isinstance(it, Iterable):
        return from_iterable.raw(it)
    raise TypeError(
        f"{type(it).__name__!r} object is not (async) iterable")
613466
def iterate(self, iterable, format="%s"):
        

        # If iterable has a definite length, then set the maximum value of the
        # progress bar. Else, set the maximum value to -1 so that the progress
        # bar displays indeterminate progress (scrolling dots).
        try:
            length = len(iterable)
        except TypeError:
            self.max = -1
        else:
            self.max = length

        # Iterate over the input, updating the progress bar for each element.
        for i, item in enumerate(iterable):
            self.update(i, format % item)
            yield item
1081005
def accumulate(iterable, func=operator.add):
    
    it = iter(iterable)
    total = next(it)
    yield total
    for element in it:
        total = func(total, element)
        yield total
67954
function it_can_execute_functions_for_each_item_in_a_collection()
    {
        $collection = [1, 2, 3];

        $this
            ->each($collection, function($item) {
                $this->raw($item);
            })
            ->getSource()
            ->shouldMatch('/123/')
        ;
    }
1346241
def each_object(collection):
    """"""
    c_path = collection_path(collection)
    paths = glob('%s/*.%s' % (c_path, _ext))
    for path in paths:
        yield load_object_at_path(path)
1094650
function each(iterator) {
    for (var i = 0, length = this.length; i < length; i++)
      iterator(this[i]);
  }
905943
def MapItemsIterator(function, items):
  """"""
  return ItemsIterator(
      items=map(function, items), total_count=items.total_count)
241517
def split_every(n, iterable):
    """"""
    items = iter(iterable)
    return itertools.takewhile(bool, (list(itertools.islice(items, n)) for _ in itertools.count()))
373907
def all_with(self, x):
        """"""

        _args = []

        for arg in self.all:
            if is_collection(x):
                for _x in x:
                    if _x in arg:
                        _args.append(arg)
                        break
            else:
                if x in arg:
                    _args.append(arg)

        return Args(_args, no_argv=True)
1003784
def _all_equal(iterable):
    """"""
    iterator = iter(iterable)
    first = next(iterator)
    return all(first == rest for rest in iterator)
283589
function each(object, func, thisp) {
	return Object.keys(object).map(key => {
		return func.call(thisp, key, object[key]);
	});
}
1111213
function each( source, iterator ) {
        if ( isArray( source ) ) {
            for ( var i = 0, len = source.length; i < len; i++ ) {
                if ( iterator( source[ i ], i ) === false ) {
                    break;
                }
            }
        }
    }
269344
def recurse(self, fn, *args):
        """"""
        fn(self, *args)
        for i in self.items:
            if isinstance(i, Hypercat):
                self.recurse(i, *args)
392009
function each(obj, iter) {
  for (var key in obj) {
    if (obj.hasOwnProperty(key)) iter(key, obj[key]);
  }
}
118813
def iterator(self):
        
        for obj in (self.execute().json().get("items") or []):
            yield self.api_obj_class(self.api, obj)