Invokes all before functions with context passed to them.
488323
def before(self, context):
        ""
        run.before_each.execute(context)
        self._invoke(self._before, context)
1019710
function pre(tmpl) {
  // Iterate over the beforeFns
  var i = 0,
      len = beforeFns.length;
  for (; i < len; i++) {
    tmpl = beforeFns[i].call(this, tmpl) || tmpl;
  }

  // Return tmpl
  return tmpl;
}
1201718
function callHandler(fn, req, res, next) {
    let context = new Context(req, res);
    if (utils.isGeneratorFunction(fn)) {
        co(fn).call(context, function (err) {
            if (err || !res.terminated) {
                next(err);
            }
        });
    } else {
        fn.call(context);
        if (!res.terminated) {
            next();
        }
    }
}
863627
function(context, all) {
  return Object.keys(all).reduce(function(bound, key) {
    if (typeof all[key] == 'object') bound[key] = bindAllTo(context, all[key]);
    else if (typeof all[key] == 'function') bound[key] = all[key].bind(context);
    else bound[key] = all[key];
    return bound;
  }, {});
}
360208
function(handlers){
      _.each(handlers, function(handler, name){
        var context = null;

        if (_.isObject(handler) && !_.isFunction(handler)){
          context = handler.context;
          handler = handler.callback;
        }

        this.setHandler(name, handler, context);
      }, this);
    }
654375
protected function addPrePromptClientMethodCall()
    {
        $args = func_get_args();
        $name = array_shift($args);
        $this->prePromptMessages[] = array($name => $args);
    }
157195
def invoke_hooks(hooks, name, *args, **kwargs):
    

    callbacks = hooks.get(name, [])

    for callback in callbacks:
        callback(*args, **kwargs)
673537
public Object beforeInvoke(Object object, String methodName, Object[] arguments) {
        if (!calls.containsKey(methodName)) calls.put(methodName, new LinkedList());
        ((List) calls.get(methodName)).add(System.currentTimeMillis());

        return null;
    }
1011284
def handler_all(func=None):
	
	if not func:
		return functools.partial(handler_all)

	registrations_global.append(func)

	return func
1151060
def execute(self, context):
        """"""
        for ware in self.middleware:
            ware.premessage(context)
            context = ware.bind(context)
            ware.postmessage(context)
        return context
235587
def context_processor(self, func):
        
        func = to_coroutine(func)
        self.providers.append(func)
        return func
926826
def call_with_context(func, context, *args):
    
    return make_context_aware(func, len(args))(*args + (context,))
1207244
def _invoke_callbacks(self, *args, **kwargs):
        """"""
        for callback in self._done_callbacks:
            _helpers.safe_invoke_callback(callback, *args, **kwargs)
3232
def before(complete = true, index = 0, &block)
        unless @before_run
          while callback = machine.callbacks[:before][index]
            index += 1
            
            if callback.type == :around
              # Around callback: need to handle recursively.  Execution only gets
              # paused if:
              # * The block fails and the callback doesn't run on failures OR
              # * The block succeeds, but after callbacks are disabled (in which
              #   case a continuation is stored for later execution)
              return if catch(:cancel) do
                callback.call(object, context, self) do
                  before(complete, index, &block)
                  
                  pause if @success && !complete
                  throw :cancel, true unless @success
                end
              end
            else
              # Normal before callback
              callback.call(object, context, self)
            end
          end
          
          @before_run = true
        end
        
        action = {:success => true}.merge(block_given? ? yield : {})
        @result, @success = action[:result], action[:success]
      end
591698
public function before()
    {

        // ~ Init timer
        $this->time = - microtime(true);

        // ~ Reporting all error (default: all error) !
        error_reporting((int) $this->argument->get('error-reporting', null, - 1));
        ini_set('display_errors', (bool) $this->argument->get('error-display', null, 1));

        // ~ Set limit time to 0 (default: unlimited) !
        set_time_limit((int) $this->argument->get('time-limit', null, 0));

        $this->isVerbose = ! $this->argument->has('quiet');
    }
756701
def first_invoke(func1, func2):
	
	def wrapper(*args, **kwargs):
		func1()
		return func2(*args, **kwargs)
	return wrapper
305201
function callExitHandlers(context) {
    var i, n;
    for (i = 0, n = this.exits.length; i < n; i++) {
      this.exits[i].call(this, context);
    }
  }