Processes a for loop. e.g.
            {% for number in numbers %}
                {{ number }}
            {% endfor %}
            {% for key, value in somemap.items() %}
                {{ key }} -> {{ value }}
            {% %}
516869
def _process_for(self, node, **kwargs):
        

        # since a for loop can introduce new names into the context
        # we need to remember the ones that existed outside the loop
        previous_stored_names = self.stored_names.copy()

        with self._execution():
            self.output.write('__runtime.each(')

            if is_method_call(node.iter, dict.keys.__name__):
                self.output.write('Object.keys(')

            self._process_node(node.iter, **kwargs)

            if is_method_call(node.iter, dict.keys.__name__):
                self.output.write(')')

            self.output.write(',')
            self.output.write('function')
            self.output.write('(')

            # javascript iterations put the value first, then the key
            if isinstance(node.target, nodes.Tuple):
                if len(node.target.items) > 2:
                    raise Exception('De-structuring more than 2 items is not supported.')

                for i, item in enumerate(reversed(node.target.items)):
                    self._process_node(item, **kwargs)
                    if i < len(node.target.items) - 1:
                        self.output.write(',')
            else:
                self._process_node(node.target, **kwargs)

            self.output.write(')')
            self.output.write('{')

            if node.test:
                self.output.write('if (!(')
                self._process_node(node.test, **kwargs)
                self.output.write(')) { return; }')

        assigns = node.target.items if isinstance(node.target, nodes.Tuple) else [node.target]

        with self._scoped_variables(assigns, **kwargs):
            for n in node.body:
                self._process_node(n, **kwargs)

        with self._execution():
            self.output.write('}')
            self.output.write(')')
            self.output.write(';')

        # restore the stored names
        self.stored_names = previous_stored_names
1108147
function For(o){
	if(o === undefined) o = {};
	this._traversed = false;
	this._options = o;
	this._scope = new ForScope(this);
	this._catcher = null;
}
12094
function (item, req, eachReq, res, next) {
          eachReq.item = item;
          eachReq[indexKey] = index;
          index++;
          next();
        }
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();
      }
    }
  }
478392
function mapLoops(node, path, down) {
        var depth = node.$depth;
        if (node.type === 'ForInStatement' && containsAwait(node)) {
            transformForIn(node, path);
        } else if (node.type === 'ForOfStatement' && containsAwait(node)) {
            iterizeForOf(node, path);
        }
        // Are we inside a loop that has already been asynchronized and is labelled?
        var inAsyncLoop = path.some(function (p) {
            return '$label' in p.self && p.self.type === 'ForStatement' && p.self.$mapped;
        });
        // Check if the loop contains an await, or a labelled exit if we're inside an async loop
        function mappableLoop(n) {
            return n.type === 'AwaitExpression' && !n.$hidden || inAsyncLoop && (n.type === 'BreakStatement' || n.type === 'ContinueStatement') && n.label;
        }
        
        if (!node.$mapped && examine(node).isLoop && contains(node, mappableLoop)) {
            path[0].self.$mapped = true;
            var p;
            var mapped = [];
            var init = node.init;
            var test = node.test || literal(true);
            var step = node.update;
            var body = node.body;
            var localised = init && init.type === 'VariableDeclaration' && (init.kind === 'let' || init.kind === 'const');
            if (localised) {
                init.kind = 'let';
            }
            if (step) {
                step = {
                    type: 'ExpressionStatement',
                    expression: step
                };
            }
            if (init) {
                if (!examine(init).isStatement) {
                    init = {
                        type: 'ExpressionStatement',
                        expression: init
                    };
                }
                if (!localised) 
                    mapped.push(init);
            }
            var ref, label;
            if (node.$label) {
                label = node.$label.name;
                ref = path[1];
            } else {
                label = generatedSymbol++;
                ref = path[0];
            }
            label = opts.generatedSymbolPrefix + "Loop_" + label;
            var idLocal = localised ? ident(label + "_local"):null ;
            var idTrampoline = ident(label + "_trampoline");
            var idIter = ident(label);
            var idStep = step ? ident(label + "_step") : idIter;
            var idContinuation = ident(label + "_exit");
            var idBounce = ident("q");
            var idCatchParam = ident("$exception");
            var continuation, deferredCode;
            if ('index' in ref) {
                var idx = ref.index;
                deferredCode = ref.parent[ref.field].splice(idx + 1, ref.parent[ref.field].length - (idx + 1));
            } else {
                deferredCode = [];
            }
            continuation = makeContinuation(idContinuation, deferredCode);
            var initIter = localised ? parsePart("$0.bind(this,$1)", [idIter,init ? init.declarations.map(function (d) {
                return d && d.init ? d.init : ident("undefined");
            }) : []]).expr : idIter;
            var returnStep = parsePart("return $0", [idStep]).body[0];
            var returnBreak = {
                type: 'ReturnStatement',
                argument: {
                    "type": "ArrayExpression",
                    "elements": [literal(1)]
                }
            };
            treeWalk(body, function mapExits(n, descend, subpath) {
                if (examine(n).isFunction || examine(n).isLoop) {
                    return true;
                } else if (n.type === 'BreakStatement' || n.type === 'ContinueStatement') {
                    if (n.label) {
                        var labelStack = subpath.filter(function (p) {
                            return '$label' in p.self;
                        }).map(function (p, idx) {
                            return p.self.$label && p.self.$label.name;
                        });
                        // Work out how many loops to exit by examining subpath.
                        var loops = [];
                        for (var l = 0;l < labelStack.length; l++) {
                            if (labelStack[l] === n.label.name) {
                                if (n.type === 'BreakStatement') 
                                    loops.push(literal(1));
                                subpath[0].replace({
                                    type: 'ReturnStatement',
                                    argument: {
                                        "type": "ArrayExpression",
                                        "elements": loops.reverse()
                                    }
                                });
                                break;
                            }
                            loops.push(literal(0));
                        }
                    } else {
                        if (n.type === 'BreakStatement') 
                            subpath[0].replace(returnBreak);
                         else 
                            subpath[0].replace(returnStep); //  continue;
                    }
                } else {
                    descend();
                }
            }, path);
            if (body.type === 'BlockStatement') 
                body = body.body.slice(0);
             else 
                body = [body];
            if (node.type === 'DoWhileStatement') {
                body = body.concat({
                    "type": "IfStatement",
                    "test": {
                        type: 'UnaryExpression',
                        argument: test,
                        prefix: true,
                        operator: '!'
                    },
                    "consequent": returnBreak,
                    alternate: returnStep
                });
            } else {
                body = [{
                    "type": "IfStatement",
                    "test": test,
                    "consequent": {
                        "type": "BlockStatement",
                        "body": body.concat(returnStep)
                    },
                    alternate: returnBreak
                }];
            }
            var decls = [];
            if (opts.noRuntime) 
                decls.push({
                "type": "VariableDeclarator",
                "id": idTrampoline
            });
            if (step && localised) 
                decls.push({
                "type": "VariableDeclarator",
                "id": idLocal
            });
            if (decls.length) 
                mapped.push({
                "type": "VariableDeclaration",
                "declarations": decls,
                "kind": "var"
            });
            var invokeIterate;
            var exit = getExit(path, [opts]).$error;
            if (opts.noRuntime) {
                invokeIterate = parsePart(
	                opts.es6target?
	                    "($idTrampoline = ((q) => { "+
	                    "    $$setMapped: while (q) { "+
	                    "         if (q.then)  "+
	                    (depth===1?
	                    "             return void q.then($idTrampoline, $exit); ":
	                    "             return q.then($idTrampoline, $exit); ")+
	                    "         try { "+
	                    "             if (q.pop)  "+
	                    "                 if (q.length)  "+
	                    "                 return q.pop() ? $idContinuation.call(this) : q; "+
	                    "              else  "+
	                    "                 q = $idStep; "+
	                    "              else  "+
	                    "                 q = q.call(this) "+
	                    "          } catch (_exception) { "+
	                    "             return $exit(_exception); "+
	                    "          } "+
	                    "     } "+
	                    "}))($idIter)":
	                    "($idTrampoline = (function (q) { "+
	                    "    $$setMapped: while (q) { "+
	                    "         if (q.then)  "+
	                    (depth===1?
	                    "             return void q.then($idTrampoline, $exit); ":
	                    "             return q.then($idTrampoline, $exit); ")+
	                    "         try { "+
	                    "             if (q.pop)  "+
	                    "                 if (q.length)  "+
	                    "                 return q.pop() ? $idContinuation.call(this) : q; "+
	                    "              else  "+
	                    "                 q = $idStep; "+
	                    "              else  "+
	                    "                 q = q.call(this) "+
	                    "          } catch (_exception) { "+
	                    "             return $exit(_exception); "+
	                    "          } "+
	                    "     } "+
	                    "}).bind(this))($idIter)",
                {
                    setMapped: function (n) {
                        n.$mapped = true;
                        return n;
                    },
                    idTrampoline: idTrampoline,
                    exit: exit,
                    idIter: initIter,
                    idContinuation: idContinuation,
                    idStep: idStep
                }).expr;
            } else {
                invokeIterate = parsePart("($0.$1.trampoline(this,$2,$3,$4,$6)($5))", [opts.$runtime ? genIdent.runtime : ident('Function'),
                    genIdent.asyncbind,idContinuation,idStep,
                    exit,initIter,literal(depth === 1)]).expr;
            }
            var iterDecls = init && init.declarations ? init.declarations.map(function (d) {
                return d.id;
            }) : [];
            if (step) {
                var stepArgs = {
                    idIter: idIter,
                    idStep: idStep,
                    step: step,
                    idLocal: idLocal,
                    decId: iterDecls
                };
                if (localised) {
                    stepArgs.iterDecls = iterDecls;
                    mapped.push(parsePart(step.expression.$EmptyExpression ? 
                    		(opts.es6target ? "function $idStep(){ return $idIter.bind(this,...$idLocal()) }" : "function $idStep(){ var [$decId] = $idLocal(); return $idIter.bind(this,$decId) }") :
                    		"function $idStep(){ var [$decId] = $idLocal(); $:step; return $idIter.bind(this,$decId) }", stepArgs).body[0]);
                    body.unshift(parsePart("$idLocal = function(){ return [$decId] }", stepArgs).body[0]);
                } else {
                    mapped.push(parsePart(step.expression.$EmptyExpression ? "function $idStep(){ return $idIter }" : "function $idStep(){ $:step; return $idIter }", stepArgs).body[0]);
                }
            }
            mapped.push({
                $label: node.$label,
                "type": "FunctionDeclaration",
                "id": idIter,
                "params": localised ? iterDecls : [],
                "body": {
                    "type": "BlockStatement",
                    "body": body
                }
            });
            mapped.push({
                type: 'ReturnStatement',
                argument: invokeIterate
            });
            mapped.push(continuation);
            path[0].replace(mapped.map(down));
        }
    }
953502
def _apply(self, element, key=None):
        
        kwargs = {}
        for hook in self._preprocess_hooks:
            kwargs.update(hook(self, element))
        ret = self._process(element, key)
        for hook in self._postprocess_hooks:
            ret = hook(self, ret, **kwargs)
        return ret
1328789
function(obj, iterator, context) {
        if (!obj) return
        else if (obj.forEach) obj.forEach(iterator)
        else if (obj.length == +obj.length) {
            for (var i = 0; i < obj.length; i++) iterator.call(context, obj[i], i)
        } else {
            for (var key in obj) iterator.call(context, obj[key], key)
        }
    }
445773
def loop_for(name, seconds, options={}, &blk)
      end_at = Time.now + seconds
      if options[:warmup]
        options[:warmup].times do |i|
          #puts "Warming up... #{i}"
          yield i
        end
      end
      i = 0
      while Time.now < end_at
        time_i(i, name, options, &blk)
        i += 1
      end
    end
460607
function (loopcount) {
			this.writeDebug('_createLocationVariables',arguments);
			var value;
			locationData = {};

			for (var key in locationset[loopcount]) {
				if (locationset[loopcount].hasOwnProperty(key)) {
					value = locationset[loopcount][key];

					if (key === 'distance' || key === 'altdistance') {
						value = this.roundNumber(value, 2);
					}

					locationData[key] = value;
				}
			}
		}
876064
def _process_loop(self):
        '''
        '''
        while not self._web_client_session.done():
            self._item_session.request = self._web_client_session.next_request()

            verdict, reason = self._should_fetch_reason()

            _logger.debug('Filter verdict {} reason {}', verdict, reason)

            if not verdict:
                self._item_session.skip()
                break

            exit_early, wait_time = yield from self._fetch_one(cast(Request, self._item_session.request))

            if wait_time:
                _logger.debug('Sleeping {}', wait_time)
                yield from asyncio.sleep(wait_time)

            if exit_early:
                break
474966
public void map(Collection<I> items, T target)
    {
        for (I item : items)
        {
            map(item, target);
        }
    }
1177536
function ForItemData(forElement, item, index) {
    this.parent = forElement.scope;
    this.raw = {};
    this.listeners = [];

    this.directive = forElement.aNode.directives['for']; // eslint-disable-line dot-notation
    this.indexName = this.directive.index || '$index';

    this.raw[this.directive.item] = item;
    this.raw[this.indexName] = index;
}
339172
function processValuesFromContext(node, params, msg, varList) {
                let pMsg = {};
                Object.assign(pMsg, params);
                varList.forEach((varItem) => {
                    if (varItem.type === undefined || params[varItem.type] === undefined) {
                        pMsg[varItem.name] = params[varItem.name];
                    } else if (params[varItem.type] === 'flow' || params[varItem.type] === 'global') {
                        pMsg[varItem.name] = RED.util.evaluateNodeProperty(params[varItem.name], params[varItem.type], node, msg);
                        pMsg[varItem.type] = params[varItem.type];
                        console.log('Inside flow or global');
                        console.log(varItem.name + ' - - ' + pMsg[varItem.name]);
                    } else {
                        pMsg[varItem.name] = params[varItem.name];
                        pMsg[varItem.type] = params[varItem.type];
                    }
                });
                return pMsg;
            }
527530
function( elems, callback, arg ) {
		var length, value,
			i = 0,
			ret = [];

		// Go through the array, translating each of the items to their new values
		if ( isArrayLike( elems ) ) {
			length = elems.length;
			for ( ; i < length; i++ ) {
				value = callback( elems[ i ], i, arg );

				if ( value != null ) {
					ret.push( value );
				}
			}

		// Go through every key on the object,
		} else {
			for ( i in elems ) {
				value = callback( elems[ i ], i, arg );

				if ( value != null ) {
					ret.push( value );
				}
			}
		}

		// Flatten any nested arrays
		return concat.apply( [], ret );
	}
504735
function( elems, callback, arg ) {
		var value,
			i = 0,
			length = elems.length,
			isArray = isArraylike( elems ),
			ret = [];

		// Go through the array, translating each of the items to their
		if ( isArray ) {
			for ( ; i < length; i++ ) {
				value = callback( elems[ i ], i, arg );

				if ( value != null ) {
					ret[ ret.length ] = value;
				}
			}

		// Go through every key on the object,
		} else {
			for ( i in elems ) {
				value = callback( elems[ i ], i, arg );

				if ( value != null ) {
					ret[ ret.length ] = value;
				}
			}
		}

		// Flatten any nested arrays
		return core_concat.apply( [], ret );
	}
352410
function processChildren( &$textElements,
                              &$children, $key, &$item, &$index, &$isFirstRun,
                              &$delimiterStructure, &$sequenceStructure, &$filterStructure,
                              $tpl, $rootNamespace, $name, $functionPlacement,
                              &$variableIterator, $noLastValue,
                              &$iteratorData )
    {
        if ( $variableIterator !== null )
        {
            unset( $last );
            if ( !$noLastValue and $iteratorData['iterator'] !== false )
            {
                $last =& $iteratorData['iterator'];
            }
            else
            {
                $last = false;
            }
            unset( $iteratorData['iterator'] );
            $iteratorData['iterator'] = new eZTemplateSectionIterator();
            $iteratorData['iterator']->setIteratorValues( $item, $key, $index, $index + 1, false, $last );
            unset( $last );

            $iteratorObject =& $iteratorData['iterator'];
            $tpl->setVariable( $variableIterator, $iteratorObject, $name );
        }
        else
        {
            $tpl->setVariable( "key", $key, $name );
            $tpl->setVariable( "item", $item, $name );
            $tpl->setVariable( "index", $index, $name );
            $tpl->setVariable( "number", $index + 1, $name );
        }
        if ( count( $filterStructure ) > 0 )
        {
            $filterCount = count( $filterStructure );
            $includeElement = true;
            for ( $i = 0; $i < $filterCount; ++$i )
            {
                $filterElement =& $filterStructure[$i];
                $filterParameters =& $filterElement[3];
                $filterName = $filterElement[2];
                $filterMatch = null;
                if ( isset( $filterParameters["match"] ) )
                {
                    $filterMatch = $tpl->elementValue( $filterParameters["match"], $rootNamespace, $name, $functionPlacement );
                    if ( $filterMatch )
                        $includeElement = $filterName == "section-exclude" ? false : true;
                }
                else
                    $tpl->missingParameter( "section:$filterName", "match" );
            }
            if ( !$includeElement )
                return false;
        }
        if ( $delimiterStructure !== null and !$isFirstRun )
        {
            $delimiterParameters = $delimiterStructure[3];
            $delimiterMatch = true;
            if ( isset( $delimiterParameters["modulo"] ) )
            {
                $delimiterModulo = $delimiterParameters["modulo"];
                $modulo = $tpl->elementValue( $delimiterModulo, $rootNamespace, $name, $functionPlacement );
                $modulo = trim( $modulo );
                if ( is_numeric( $modulo ) )
                    $delimiterMatch = ( $index % $modulo ) == 0;
            }
            if ( isset( $delimiterParameters["match"] ) )
            {
                $delimiterMatchParameter = $delimiterParameters["match"];
                $delimiterMatch = $tpl->elementValue( $delimiterMatchParameter, $rootNamespace, $name, $functionPlacement );
            }
            if ( $delimiterMatch )
            {
                $delimiterChildren =& $delimiterStructure[1];
                if ( is_array( $delimiterChildren ) )
                {
                    foreach ( array_keys( $delimiterChildren ) as $delimiterChildKey )
                    {
                        $delimiterChild =& $delimiterChildren[$delimiterChildKey];
                        $tpl->processNode( $delimiterChild, $textElements, $rootNamespace, $name );
                    }
                }
            }
        }
        $isFirstRun = false;
        if ( $sequenceStructure !== null and is_array( $sequenceStructure ) )
        {
            $sequenceValue = array_shift( $sequenceStructure );
            if ( $variableIterator !== null )
            {
                $iteratorData['iterator']->setSequence( $sequenceValue );
            }
            else
            {
                $tpl->setVariable( "sequence", $sequenceValue, $name );
            }
            $sequenceStructure[] = $sequenceValue;
        }
        foreach ( array_keys( $children ) as $childKey )
        {
            $child =& $children[$childKey];
            $tpl->processNode( $child, $textElements, $rootNamespace, $name );
        }
        ++$index;
        return true;
    }
1308732
def perform_templating(args):
    """"""
    engine = engines.engines[args.engine]

    if args.vary:
        it = variable_outfile_iterator(args.outfiles,
                                       args.infiles,
                                       args.args,
                                       engine)
    else:
        it = constant_outfile_iterator(args.outfiles,
                                       args.infiles,
                                       args.args)

    process_combinations(it, engine,
                         tolerant=args.tolerant,
                         read_old=args.read_old,
                         delete_empty=args.delete_empty,
                         )