specific to how a function is dispatched.
5082
private List<Map<String, Result<R>>> handleRetcodeBatchingHack(List<Map<String, Result<R>>> list, Type xor) {
        return list.stream().map(m -> {
            return m.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> {
                return e.getValue().fold(err -> {
                    return err.<Result<R>>fold(
                            Result::error,
                            Result::error,
                            parsingError -> {
                                if (parsingError.getJson().isJsonObject()) {
                                    JsonObject jsonObject = parsingError.getJson().getAsJsonObject();
                                    if (jsonObject.has("retcode")) {
                                        jsonObject.remove("retcode");
                                        return JsonParser.GSON.fromJson(jsonObject, xor);
                                    } else {
                                        return Result.error(parsingError);
                                    }
                                } else {
                                    return Result.error(parsingError);
                                }
                            },
                            Result::error
                    );
                }, Result::success);
            }));
        }).collect(Collectors.toList());
    }
133298
def _function_handler(function, args, kwargs, future):
    """"""
    future.set_running_or_notify_cancel()

    try:
        result = function(*args, **kwargs)
    except BaseException as error:
        error.traceback = format_exc()
        future.set_exception(error)
    else:
        future.set_result(result)
1043282
def _dispatch(self, method, params):
        """"""
        self._count += 1

        func = getattr(self, method)
        try:
            return func(*params)
        except Exception as e:
            traceback.print_exc()
            raise e
897129
def _handle_job_set(function):
    
    def call(self, job_set=taskhandle.NullJobSet()):
        job_set.started_job(str(self))
        function(self)
        job_set.finished_job()
    return call
296482
function process (event, nxt) {

      // Publish it now...
      debug('publish event...');
      dispatcher.publisher(event.payload, function(err) {
        if (err) {
          return debug(err);
        }
        // ...and set the published event to dispatched.
        debug('set event to dispatched...');
        dispatcher.store.setEventToDispatched(event, function(err) {
          if (err) {
            debug(err);
          } else {
            debug('event set to dispatched');
          }
        });
      });

      nxt();
    }
850644
def dispatch(self, category, func, *args):
        """"""
        self.factory.loader.runPlugins(category, func, self, *args)
1134575
def dispatch(self):
        ''
        import flask
        body = flask.request.get_json()
        return self. dispatch_with_args(body, argMap=dict())
1102874
def dispatch(self):
        """"""
        method_name = 'on_' + self.environ['REQUEST_METHOD'].lower()
        method = getattr(self, method_name, None)
        if method:
            return method()
        else:
            return self.on_bad_method()
225031
def handle(event):
        
        def dec(func):
            if not hasattr(func, '_handle_events'):
                func._handle_events = set()
            func._handle_events.add(event)
            return func

        return dec
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();
        }
    }
}
700921
function (opts, cb) {
      layered.onReady(function () {
        if(isFunction(opts))
          cb = opts, opts = {}
        cb(null, layered.getHops(opts))
      })
    }
105798
def function_call_prepare_action(self, text, loc, fun):
        """"""
        exshared.setpos(loc, text)
        if DEBUG > 0:
            print("FUN_PREP:",fun)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        index = self.symtab.lookup_symbol(fun.name, SharedData.KINDS.FUNCTION)
        if index == None:
            raise SemanticException("'%s' is not a function" % fun.name)
        #save any previous function call data (for nested function calls)
        self.function_call_stack.append(self.function_call_index)
        self.function_call_index = index
        self.function_arguments_stack.append(self.function_arguments[:])
        del self.function_arguments[:]
        self.codegen.save_used_registers()
747084
function (dispatcher) {

    if (dispatchers.isDispatcher(dispatcher)) {
      this.dispatcher = dispatcher;
    } else {
      this.dispatcher = new dispatchers.Dispatcher();
    }

    var action = this;
    var prototype = Object.getPrototypeOf(this);
    Object.keys(prototype).forEach(function (method) {
      if (method !== 'dispatch') {
        action[method] = function () {
          var ret = prototype[method].apply(action, arguments);
          if (typeof ret !== 'undefined') {
            action.dispatch(ret);
          }
        };
      }
    });
  }
191202
function (name) {
        (Array.isArray(this._pending) ? this._pending : (this._pending = [])).push(arguments);
        this.emit(DISPATCHQUEUE_EVENT, name);
    }
258971
def dispatch(self, request, *args, **kwargs):
        
        # this part copied from django source code
        if request.method.lower() in self.http_method_names:
            handler = getattr(self, request.method.lower(),
                              self.http_method_not_allowed)
        else:
            handler = self.http_method_not_allowed
        # we changed only this line - removed first 'request' argument
        return handler(*args, **kwargs)
622643
def dispatch(self, request, *args, **kwargs):
        
        self.request = request
        self.args = args
        self.kwargs = kwargs
        response = self.check_permissions(request)
        if response:
            return response
        return super().dispatch(request, *args, **kwargs)
2615
function handle() {
          for (
            var i = 0
              , length = args.length;

            i < length;
            self.removeListener(args[i++], handle)
          ){}

          // call the function as last as the function might be calling on of
          // events that where in our either queue, so we need to make sure that
          // everything is removed
          callback.apply(self, arguments);
        }