https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L114.
332769
def nl_msg_in_handler_debug(msg, arg):
    """"""
    ofd = arg or _LOGGER.debug
    ofd('-- Debug: Received Message:')
    nl_msg_dump(msg, ofd)
    return NL_OK
376333
function isErrorHandler (cb) {
  var str = cb.toString()
  var args = str.split('(')[1].split(')')[0].split(',')
  return args.length === 4
}
790850
function createBindingHandlers({
    fullEventName,
    domEventHandler,
    selector
}) {
    return {
        bindHandler(evt = {}) {
            const { node } = evt;
            if (node) {
                dom.$(node).on(fullEventName, selector, domEventHandler);
            }
        },
        unbindHandler(evt = {}) {
            const { node } = evt;
            if (node) {
                dom.$(node).off(fullEventName, selector, domEventHandler);
            }
        }
    };
}
1304996
function wrapArguments(trace, clientState, hooks) {
  //wrap any callbacks found in the arguments
  var args = trace.args;
  var handler = clientState.rules.handleArgs(trace.funInfo.name);
  if (handler) {
    handler(trace, clientState);
  }
  for (var i = args.length - 1; i >= 0; i--) {
    var a = args[i];
    if (util.isFunction(a) && !a.__concurix_blacklisted) {
      var callbackState = {
        modInfo: clientState.modInfo,
        rules: clientState.rules,
        callbackOf: trace
      };

      if (wrap.isWrapper(args[i])) {
        args[i].__concurix_proxy_state__
          .module((trace.calledBy && trace.calledBy.moduleName) || 'root')
          .state(callbackState)
          .nameIfNeeded(trace.funInfo.name + ' callback')
          .getProxy();
      }
      else {
        args[i] = wrap(a)
          .before(hooks.beforeHook)
          .after(hooks.afterHook)
          .module((trace.calledBy && trace.calledBy.moduleName) || 'root')
          .state(callbackState)
          .nameIfNeeded(trace.funInfo.name + ' callback')
          .getProxy();
      }
      trace.origFunctionArguments = trace.origFunctionArguments || [];
      trace.origFunctionArguments.push(a);
    }
  }
}
161628
static Node getExceptionHandler(Node n) {
    for (Node cur = n;
        !cur.isScript() && !cur.isFunction();
        cur = cur.getParent()) {
      Node catchNode = getCatchHandlerForBlock(cur);
      if (catchNode != null) {
        return catchNode;
      }
    }
    return null;
  }
22748
function consoleHandler(entry) {
  if (typeof console === 'undefined' || !console) {
    return;
  }

  var timestamp = new Date(entry.timestamp);
  var msg =
      '[' + timestamp.getUTCFullYear() + '-' +
      pad(timestamp.getUTCMonth() + 1) + '-' +
      pad(timestamp.getUTCDate()) + 'T' +
      pad(timestamp.getUTCHours()) + ':' +
      pad(timestamp.getUTCMinutes()) + ':' +
      pad(timestamp.getUTCSeconds()) + 'Z] ' +
      '[' + entry.level.name + '] ' +
      entry.message;

  var level = entry.level.value;
  if (level >= Level.SEVERE.value) {
    console.error(msg);
  } else if (level >= Level.WARNING.value) {
    console.warn(msg);
  } else {
    console.log(msg);
  }
}
295209
function catchError(selector) {
    return function catchErrorOperatorFunction(source) {
        var operator = new CatchOperator(selector);
        var caught = source.lift(operator);
        return (operator.caught = caught);
    };
}
1251916
function dbRequestHandler( req, res, next ) {
  /**
   * @type {Object}
   *
   * @property {Object} [db]
   * @property {Error} [db.error]
   * @property {setupDb} [db.setupDb]
   *
   * @property {boolean} [debug]
   */
  var app = req.app

  if ( app.debug ) {
    console.log( '[debug]', new Date().toGMTString(), 'dbRequestHandler()' )
  }

  if ( !app.db ) {
    return next()
  }

  if ( !app.db.error ) {
    return next()
  }

  if ( typeof app.setupDb !== 'function' ) {
    return next()
  }

  if ( typeof app.db._readyState !== 'undefined' && app.db._readyState !== 0 ) {
    return next()
  }

  console.log( '[warn]', new Date().toGMTString(), 'attempting to reconnect to mongodb://%host:%port/%database'
    .replace( '%host', app.db.host )
    .replace( '%port', app.db.port )
    .replace( '%database', app.db.name )
  )

  app.setupDb()
    .then(
      /**
       * @param {Object} db
       * @returns {*}
       */
      function ( db ) {
        app.db = db;

        return next()
      }
    )
    .catch(
      /**
       * @param {Error} err
       * @returns {*}
       */
      function ( err ) {
        if ( process.env.NODE_ENV !== 'development' ) {
          console.error( err )
          err = new DatabaseError( err.code, 'please try again later ...' )
        }

        err.statusCode = err.statusCode || 500;

        app.db = {
          error: err
        };

        return next( err )
      }
    );
}
751911
function (elem)
    {
        var result = null;
        try {
            result = this.handler(elem);
        } catch (e) {
            if (e.sourceURL) {
                Strophe.fatal("error: " + this.handler +
                              " " + e.sourceURL + ":" +
                              e.line + " - " + e.name + ": " + e.message);
            } else if (e.fileName) {
                if (typeof(console) != "undefined") {
                    console.trace();
                    console.error(this.handler, " - error - ", e, e.message);
                }
                Strophe.fatal("error: " + this.handler + " " +
                              e.fileName + ":" + e.lineNumber + " - " +
                              e.name + ": " + e.message);
            } else {
                Strophe.fatal("error: " + e.message + "\n" + e.stack);
            }

            throw e;
        }

        return result;
    }
205185
function wrapHandler(handler) {
  return function (state, ...args) {
    return _.assign({}, state, handler(state, ...args));
  };
}
73603
function _errorHandlers() {
  // middleware with an arity of 4 are considered
  // error handling middleware. When you next(err)
  // it will be passed through the defined middleware
  // in order, but ONLY those with an arity of 4, ignoring
  // regular middleware.
  app.use(function(err, req, res, next){
    logger.error(err);
    console.trace();
    if(req.accepts('html') || req.is('html')) {
      res.status(err.status || 500);
      res.render('500', { error: err });
      return;
    }
    res.send(err.status || 500, { error: err.message });
  });

  // our custom JSON 404 middleware. Since it's placed last
  // it will be the last middleware called, if all others
  // invoke next() and do not respond.
  app.use(function(req, res) {
    logger.error('Failed to locate:'+req.url);
    console.trace();
    if(req.accepts('html') || req.is('html')) {
      res.status(404);
      res.render('404', { url: req.url });
      return;
    }
    res.send(404, { error: "can't find the resource" });
  });
}
1079343
function getWebpackRunnableLambda(slsWebpack, stats, functionName) {
  const handler = slsWebpack.loadHandler(stats, functionName, true)
  const context = slsWebpack.getContext(functionName)
  return wrapHandler(handler, context)
}
392294
function certBlob() {
	var self = {
		cbCert : new type.UInt32Le(function() {
			return self.abCert.size();
		}),
        abCert : new type.BinaryString(null, { readLength : new type.CallableValue(function() {
        	return self.cbCert.value;
        }) })
	};
	
	return new type.Component(self);
}
27043
function execNewBindingHandlerOnNode(bindingKeyAndHandler, node, getValueAccessor, allBindings, bindingContext, reportBindingError) {
      var bindingKey = bindingKeyAndHandler.key,
          handlerParams = {
              element: node,
              $data: bindingContext.$data,
              $context: bindingContext,
              allBindings: allBindings
          },
          handlerConstructor = bindingKeyAndHandler.handler,
          handlerInstance,
          subscriptions = [];

      Object.defineProperty(handlerParams, 'value', {
          get: function () { return getValueAccessor(bindingKey)(); }
      });

      function handlerConstructorWrapper() {
          handlerInstance = this;

          // The handler instance will have properties `computed` and
          // `subscribe`, which are almost the same as the `ko.-` equivalent
          // except their lifecycle is limited to that of the node (i.e.
          // they are automatically disposed).
          this.computed = function handlerInstanceComputed(functionOrObject) {
              var settings = typeof functionOrObject === 'function' ?
                  { read: functionOrObject, write: functionOrObject } :
                  functionOrObject;
              extend(settings, {
                  owner: handlerInstance,
                  disposeWhenNodeIsRemoved: node
              });
              return computed(settings);
          };

          this.subscribe = function handlerInstanceSubscription(subscribable, callback, eventType) {
              subscriptions.push(
                  subscribable.subscribe(callback, handlerInstance, eventType)
              );
          };

          this.value = this.computed(function () {
              return getValueAccessor(bindingKey)();
          });

          handlerConstructor.call(this, handlerParams);
      }

      // We have to wrap the handler instance in this "subclass" because
      // it's the only way to define this.computed/subscribe before the
      // handlerConstructor is called, and one would expect those
      // utilities to be available in the constructor.
      extend(handlerConstructorWrapper, handlerConstructor);
      handlerConstructorWrapper.prototype = handlerConstructor.prototype;

      try {
          new handlerConstructorWrapper();
      } catch(ex) {
          reportBindingError('construction', ex);
      }

      addDisposeCallback(node, function () {
          if (typeof handlerInstance.dispose === "function") {
              handlerInstance.dispose.call(handlerInstance);
          }
          arrayForEach(subscriptions, function (subs) {
              subs.dispose();
          });
      });

      return handlerConstructor.controlsDescendantBindings || handlerInstance.controlsDescendantBindings;
  }
368724
function handleOperation(handlers, mode, checkArity, req, res, done) {
  // parse path:
  // - first part is the operation name
  // - the following components of the path are used as arguments
  const parsedParts = parsePath(req);
  if (parsedParts[0].length === 0) {
    done(new ModofunError(403, 'NoOperation', 'Operation must be specified!'));
    return;
  }
  const [operation, ...args] = parsedParts;

  if (operation && handlers.hasOwnProperty(operation)) {
    // the stack of operation specific middleware
    let operationMiddleware = [];
    // operation handler
    let operationHandler = handlers[operation];

    if (Array.isArray(operationHandler)) {
      // if an array is passed, add operation specific middleware
      // last item in the array should be the operation handler
      operationMiddleware = operationHandler.slice(0, -1);
      operationHandler = operationHandler[operationHandler.length-1];

    } else if (typeof operationHandler !== 'function') {
      // otherwise return internal error
      done(new ModofunError(500, 'InvalidConfig', 'Handler must be a function or array'));
      return;
    }

    // call middleware stack with same req/res context
    runMiddlewareStack(operationMiddleware, req, res, (err) => {
      if (err) {
        done(err);
        return;
      }
      try {
        // call handler function
        if (mode === FUNCTION_MODE) {
          invokeFunctionHandler(operationHandler, args, checkArity, req, res, done);
        } else {
          invokeHTTPHandler(operationHandler, args, req, res, done);
        }
      } catch(err) {
        done(err);
      }
    });

  } else {
    // fail if requested operation cannot be resolved
    done(new ModofunError(404, 'NotFound', `No handler for: ${operation}`));
    return;
  }
}
689532
function Delegate(subscribed, unsubscribed) {
  var handlers = [];

  function callable(handler) {
    if (arguments.length !== 1) {
      throw new Error('Delegate takes exactly 1 argument (' + arguments.length + ' given)');
    } else if (typeof handler !== 'function') {
      throw new Error('Delegate argument must be a Function object (got ' + typeof handler + ')');
    }
    // Add the handler
    handlers.push(handler);
    // Allow custom logic on subscribe, passing in the handler
    var subscribedResult;
    if (subscribed) {
      subscribedResult = subscribed(handler);
    }
    // Return the unsubscribe function
    return function unsubscribe() {
      var initialHandler = util.removeLast(handlers, handler);
      // Allow custom logic on unsubscribe, passing in the original handler
      if (unsubscribed) {
        unsubscribed(initialHandler, subscribedResult);
      }
      // Return the original handler
      return initialHandler;
    };
  }
  callable.invoke = function invoke() {
    var args = arguments;
    util.forEach(handlers, function (handler) {
      handler.apply(null, args);
    });
  };
  // Expose handlers for inspection
  callable.handlers = handlers;

  return callable;
}
629580
def create_handlers_map(prefix='.*'):
  
  return [
      (prefix + '/output', _BarrierHandler),
      (prefix + '/run', _PipelineHandler),
      (prefix + '/finalized', _PipelineHandler),
      (prefix + '/cleanup', _CleanupHandler),
      (prefix + '/abort', _PipelineHandler),
      (prefix + '/fanout', _FanoutHandler),
      (prefix + '/fanout_abort', _FanoutAbortHandler),
      (prefix + '/callback', _CallbackHandler),
      (prefix + '/rpc/tree', status_ui._TreeStatusHandler),
      (prefix + '/rpc/class_paths', status_ui._ClassPathListHandler),
      (prefix + '/rpc/list', status_ui._RootListHandler),
      (prefix + '(/.+)', status_ui._StatusUiHandler),
      ]