Iterate through the stack and build a single
 callable object which consists of each operation
 referencing the next one in the chain
172791
def build_operation_chain(stack)
      empty_op = EmptyOperation.new(nil)

      stack.reverse.reduce(empty_op) do |next_op, current_op|
        klass, args, block = current_op

        if Class === klass
          klass.new(next_op, *args, &block)
        elsif Proc === klass
          lambda do |env|
            next_op.call(klass.call(env, *args))
          end
        else
          raise StandardError, "Invalid operation, doesn't respond to `call`: #{klass.inspect}"
        end
      end
    end
283589
function each(object, func, thisp) {
	return Object.keys(object).map(key => {
		return func.call(thisp, key, object[key]);
	});
}
230818
def each
      callback = lambda do |key, value, _|
        yield [Base.typecast(key).retain.release_on_gc, Base.typecast(value).retain.release_on_gc]
      end
      CF.CFDictionaryApplyFunction(self, callback, nil)
      self
    end
548847
function eachObj(obj, iteratee, context) {
  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      iteratee.call(context || obj, key, obj[key]);
    }
  }
}
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.
        }
      }
    }
  }
}
1258449
function iterator(obj, iteratee, memo, keys, index, length) {
                  for (; index >= 0 && index < length; index += dir) {
                    var currentKey = keys ? keys[index] : index;
                    memo = iteratee(memo, obj[currentKey], currentKey, obj);
                  }
                  return memo;
                }
194717
def _build_stack(self) -> List[Callable]:
        

        stack = []

        for m in self.manager.middlewares:
            try:
                stack.append(getattr(m(self), self.name))
            except AttributeError:
                pass

        return stack
415564
public static <T> T eachWithIndex(T self, Closure closure) {
        final Object[] args = new Object[2];
        int counter = 0;
        for (Iterator iter = InvokerHelper.asIterator(self); iter.hasNext();) {
            args[0] = iter.next();
            args[1] = counter++;
            closure.call(args);
        }
        return self;
    }
574623
def load(self):
        
        s = load_stack(self)
        if s:
            self.hooks = s.hooks
            self.calls = s.calls
1196027
private Object doNewInner(Object obj, boolean toLHS,
            CallStack callstack, Interpreter interpreter) throws EvalError {
        BSHAllocationExpression alloc = (BSHAllocationExpression) jjtGetChild(0);
        if (Reflect.isGeneratedClass(obj.getClass())) {
            callstack.pop();
            callstack.push(Reflect.getThisNS(obj));
            return alloc.eval(callstack, interpreter);
        }

        return alloc.constructFromEnclosingInstance(obj, callstack, interpreter);
    }
449994
def Next(self):
        
        stacktop = self.stack[-1]
        
        # Now we're iterating -- push a new mutable object onto the stack
        if stacktop.index == -1:
            stacktop = _Frame(None, index=0)
            self.stack.append(stacktop)
        
        context_array = self.stack[-2].context
        
        if stacktop.index == len(context_array):
            self.stack.pop()
            raise StopIteration
        
        stacktop.context = context_array[stacktop.index]
        stacktop.index += 1
        
        return True
541218
function chainAndCall(chainer) {
    return function(/*step1, step2, ...*/) {
        var steps = slice.call(arguments);
	    var callback = steps.pop();
	    chainer.apply(null, steps)(callback);
    };
}
188001
def build(obj: Any, *applicators: Callable[..., Any]) -> Any:
    
    if isinstance(obj, BaseChain):
        return pipe(obj, copy(), *applicators)
    else:
        return pipe(obj, *applicators)
207127
def as_list(callable):
    """"""
    @wraps(callable)
    def wrapper(value_iter):
        return [callable(value) for value in value_iter]

    return wrapper
937972
def __store_callable(self, o, method_name, member):
        
        self.__store__['callables'][method_name] = eval( "o." + method_name )
        self.__store__['callables'][method_name[0].lower() + method_name[1:]] = eval( "o." + method_name )
        ret_val = self.__wrap( method_name )
        self.__store__[ method_name ] = ret_val
        self.__store__[ method_name[0].lower() + method_name[1:] ] = ret_val
137874
function iterate(object, callback, thisObject){
    var result = [];

    for (var key in object)
      result.push(callback.call(thisObject, key, object[key]));

    return result;
  }
676019
function each(obj, iterator, context) {
    var i;

    if (!obj) {
        return;
    }

    if (obj.forEach) {
        obj.forEach(iterator, context);
    } else if (obj.length !== undefined) {
        i = 0;
        while (i < obj.length) {
            iterator.call(context, obj[i], i, obj);
            i++;
        }
    } else {
        for (i in obj) {
            obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
        }
    }
}