Apply functions to the stack, passing the resulting stack to next state.
555230
def apply(funcs, stack):
  ''''''
  return reduce(lambda x, y: y(x), funcs, stack)
1094424
function applySuperMethod (fn, sup) {
        return function () {
            var prev, result;
            prev = this.sup;
            this.sup = sup;
            result = fn.apply(this, arguments);
            this.sup = prev;
            if (typeof this.sup === 'undefined') {
                delete this.sup;
            }
            return result;
        };
    }
969461
function(next) {
	return function(e) {
		if (e) {
			throw e;
		}
		var args = Array.prototype.slice.call(arguments,1);
		next.apply(this, args);
	};
}
452963
function wrap(func) {
  if (!util.is('Function', func)) { func = function noop(){}; }

  return function wrapper() {
    try {
      return func.apply(this, arguments);
    } catch(err) {
      this.notify(err, {stackShift: 3});
      throw(err);
    }
  }.bind(this);
}
276760
function FNStack() {
    var stack = slice.call(arguments, 0).filter(function iterator(val) {
        return typeof val === "function";
    });

    this._context = null;
    this.stack = stack;

    return this;
}
736867
public static void setStack(final Collection<String> stack) {
        if (stack.isEmpty() || !useStack) {
            return;
        }
        contextStack.clear();
        contextStack.addAll(stack);
    }
1157392
function applyNew(cls, args) {
    args = _.toArray(args);
    args.unshift(null);
    return new (cls.bind.apply(cls, args));
  }
896325
function routine (fn, sets, context) {
  const master = []

  if (typeof context === 'undefined') {
    context = fn
  }

  for (const args of sets) {
    master.push(fn.apply(context, Array.isArray(args) ? args : [args]))
  }

  return Promise.all(master)
}
140599
function () {
    // If this function was not given any arguments, we have nothing to do
    // here.
    if (arguments.length > 0) {
      // Convert `arguments` to an array
      var args = Array.prototype.slice.call(arguments, 0)
      Array.prototype.push.apply(passed_args, args)
    }
    self._iterate_stack(++index, req, passed_args, not_handled_fn)
  }
1159440
def call(*args)

      bottom = stack_top

      load_onto_stack
        # load function on stack

      args.each { |arg| stack_push(arg) }
        # push arguments on stack

      pcall(bottom, args.length, nil, nil, nil)
    end
288373
function applyStack(chain, stack) {
			// console.log("apply stack ", stack)
			var stacki = stack[0],
				i = 0,
				tmp,
				topSheets = [];
			while (stacki) {
				tmp = [];
				while (stacki && !stacki._deep_sheet_ && typeof stacki !== 'function') {
					if (stacki._transformations)
						topSheets = topSheets.concat(stacki._transformations);
					tmp.unshift(stacki);
					stacki = stack[++i];
				}
				if (tmp.length > 0) {
					chain.done(function(entry) {
						// console.log("apply stack will apply non sheets", tmp, " on ", entry.path, entry.value)
						entry.value = compiler.upFromArgs(entry.value, tmp, {
							excludeGrounds: true
						});
						return entry;
					});
				}
				if (!stacki)
					break;
				var sheets = [];
				while (stacki && (stacki._deep_sheet_ || typeof stacki === 'function')) {
					sheets.push(stacki);
					stacki = stack[++i];
				}
				chain.done(function(entry) {
					var s = entry.value;
					if (!s || !sheets.length)
						return entry;
					this.done(function(res) {
						if (res)
							if (res._deep_query_node_)
								entry.value = res.value;
							else
								entry.value = res;
						return entry;
					})
					sheets.unshift(entry);
					return nodes.sheet.apply(nodes, sheets);
				});
				//.log("flatten applyStack done")
			}
			return topSheets;
		}
595370
function() {
			try {
				if (fn) {
					/**
					 * Insert a done() or ok() argument to other needed arguments
					 */
					syntheticArgs.unshift(function() {
						/**
						 * Call the next in queue
						 */
						$this.next.apply($this, arguments);
					});
					/**
					 * Call the function finally
					 */
					fn.apply(this, syntheticArgs);
				} else {
					syntheticArgs = syntheticArgs || [];
					/**
					 * If no function passed, call the next in queue
					 */
					$this.next.apply(this, syntheticArgs);
				}
			} catch(e) {
				/**
				 * An error caught is thrown directly to the catch handler, if any
				 */
				if (this.onCatch) {
					this.onCatch(e);
				} else {
					throw e;
				}
			}
		}
1252578
def after(self, existing_fn, new_fn):
        """"""
        self.warn_if_function_not_registered(new_fn)
        try:
            index = self._stack.index(existing_fn)
            self._stack.insert(index + 1, new_fn)
        except ValueError as e:
            six.raise_from(BaseLunrException("Cannot find existing_fn"), e)
377786
def _map_promise(map_fn, all_inputs):
  """"""
  all_promises = utils.map_nested(map_fn, all_inputs)  # Apply the function
  res = utils.map_nested(_wait_on_promise, all_promises)
  return res
408498
function applied(fn, scope) {
    if (fn.wrappedInApply) {
      return fn;
    }
    var wrapped = function() {
      var args = arguments;
      var phase = scope.$root.$$phase;
      if (phase === "$apply" || phase === "$digest") {
        return fn.apply(null, args);
      } else {
        return scope.$apply(function() {
          return fn.apply( null, args );
        });
      }
    };
    wrapped.wrappedInApply = true;
    return wrapped;
  }
1210237
private void add(State[] stack, State state) {

        if (stackElements != 0) {
            System.arraycopy(stack, 0, stack, 1, stackElements);
        }

        stack[0] = state;
        stackElements++;
    }
158169
def state_push(self):
        ""
        for of in self.output_fns:
            if hasattr(of,'state_push'):
                of.state_push()
        super(PatternGenerator, self).state_push()