Generates the stack of functions to call. It looks at the ordered list
        of all middlewares and only keeps those which have the method we're
        trying to call.
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
645685
def _init_methods(self):
        
        for name_group in self._METHOD_GROUPS:
            functions = getattr(self, name_group, ())
            uniques = {}
            for func in functions:
                name_func = func.__name__
                method = types.MethodType(func, self)
                setattr(self, name_func, method)
                shortname = '_'.join(name_func.split('_')[:-1])
                if shortname in uniques:
                    uniques[shortname] = None
                else:
                    uniques[shortname] = method
            for (shortname, method) in uniques.items():
                if method is not None:
                    setattr(self, shortname, method)
1003472
def functions(self):
        
        names = []

        for i, k in enumerate(self.obj):
            if _(self.obj[k]).isCallable():
                names.append(k)

        return self._wrap(sorted(names))
1232090
function run () {
  var midSequence = this.middlewares.reverse()
  var initialNext = this.next.bind()
  var req = this.req
  var res = this.res
  var nestedCallSequence

  // create the call sequence
  nestedCallSequence = midSequence.reduce(middlewareReducer, initialNext)
  // call it
  nestedCallSequence.call()

  /**
   * Reduce the middleware sequence to a nested middleware handler sequence
   * @function
   * @inner
   * @private
   * @param {Function} callSequence intermediate resulting call sequence
   * @param {Function} middleware the current middleware
   * @returns {Function} the new intermediate resulting call sequence
   */
  function middlewareReducer (callSequence, middleware) {
    return function nextHandler (err) {
      // if the previous middleware passed an error argument
      if (err !== undefined) {
        if (isErrorHandler(middleware)) {
          // call the current middleware if it is an error handler middleware
          middleware(err, req, res, callSequence)
        } else {
          // else skip the current middleware and call the intermediate sequence
          callSequence(err)
        }
      } else {
        // if no error argument is passed
        if (isErrorHandler(middleware)) {
          // skip the current middleware if it is an errorHandler
          callSequence()
        } else {
          // else call it
          middleware(req, res, callSequence)
        }
      }
    }
  }
}
682982
def system_listMethods(self):
        """"""

        methods = set(self.funcs.keys())
        if self.instance is not None:
            # Instance can implement _listMethod to return a list of
            # methods
            if hasattr(self.instance, '_listMethods'):
                methods |= set(self.instance._listMethods())
            # if the instance has a _dispatch method then we
            # don't have enough information to provide a list
            # of methods
            elif not hasattr(self.instance, '_dispatch'):
                methods |= set(list_public_methods(self.instance))
        return sorted(methods)
106777
def decorator(caller, _func=None):
    """"""
    if _func is not None:  # return a decorated function
        # this is obsolete behavior; you should use decorate instead
        return decorate(_func, caller)
    # else return a decorator function
    if inspect.isclass(caller):
        name = caller.__name__.lower()
        doc = 'decorator(%s) converts functions/generators into ' \
              'factories of %s objects' % (caller.__name__, caller.__name__)
    elif inspect.isfunction(caller):
        if caller.__name__ == '<lambda>':
            name = '_lambda_'
        else:
            name = caller.__name__
        doc = caller.__doc__
    else:  # assume caller is an object with a __call__ method
        name = caller.__class__.__name__.lower()
        doc = caller.__call__.__doc__
    evaldict = dict(_call_=caller, _decorate_=decorate)
    return FunctionMaker.create(
        '%s(func)' % name, 'return _decorate_(func, _call_)',
        evaldict, doc=doc, module=caller.__module__,
        __wrapped__=caller)
1091461
function use () {
  // init hooks
  if (!this.hasOwnProperty('_hooks')) {
    this._hooks = {}
  }

  var args = Array.prototype.slice.call(arguments)
  var i, j, l, m
  var name = null

  if (is.array(args[0])) {
    // use(['a','b','c'], ...)
    var arr = args.shift()
    for (i = 0, l = arr.length; i < l; i++) {
      use.apply(this, [arr[i]].concat(args))
    }
    return this
  } else if (is.object(args[0]) && args[0]._hooks) {
    // use(ginga)
    var key
    // concat hooks
    for (key in args[0]._hooks) {
      use.call(this, key, args[0]._hooks[key])
    }
    return this
  }

  // method name
  if (is.string(args[0])) name = args.shift()
  if (!name) throw new Error('Method name is not defined.')
  if (!this._hooks[name]) this._hooks[name] = []

  for (i = 0, l = args.length; i < l; i++) {
    if (is.function(args[i])) {
      this._hooks[name].push(wrapFn(args[i]))
    } else if (is.array(args[i])) {
      // use('a', [fn1, fn2, fn3])
      for (j = 0, m = args[i].length; j < m; j++) {
        use.call(this, name, args[i][j])
      }
      return this
    } else {
      throw new Error('Middleware must be a function')
    }
  }
  return this
}
490488
function GENERATE_METHOD(name, spec, parent) {
  name = name.replace(/!+$/, '');
  return GENERATE_DOC(spec.description + '\n'
    + '@method ' + name + '\n'
    + (parent ? ('@for ' + parent + '\n') : '@for common\n')
    + _.reduce(spec.params, function(memo, paramSpec, paramName) {
        return memo + '@param {' + GENERATE_TYPE(paramSpec.type) + '} ' + paramName + ' ' + paramSpec.description + '\n'; 
      }, '')
    + ( !_.isEmpty(spec.return) ? ('@return {' + GENERATE_TYPE(spec.return.type) + '} ' + spec.return.description + '\n') : ''));
}
758703
function generateRerenderCallback(scope) {
        return function () {
            var remodel = scope.remodel || function () { return true; };
            return $q.when(remodel(scope))
                .then(function () {
                    return scope.rerenderComponent();
                });
        };
    }
1218914
def collect(self):
        
        class_functions = []
        for key in self.__class__.__dict__.keys():
            func = self.__class__.__dict__[key]
            if (inspect.isfunction(func)):
                class_functions.append(func)

        functions = sorted(class_functions, key=lambda func: func.__name__)
        for function in functions:
            value = function(self)
            if value:
                return value
820060
function (method, endpoint, routerMiddelware) {
		var self = this;

		if (typeof routerMiddelware == 'object'){
			this.app[method](endpoint, function (req, res, next) {
				var middlewareFunction = []
				routerMiddelware.forEach(function (m) {
					middlewareFunction.push(function (cb) {
						self.__exec__middlewares(m, req, res, cb);
					});
				});

				async.waterfall(middlewareFunction);
			});
		} else {
			this.app[method](endpoint, function (req, res, next) {
				self.__exec__middleware(routerMiddelware)(req, res, next);
			});
		}
	}
177651
def apply_middleware(*middlewares):
    
    def inner(create_store_):
        def create_wrapper(reducer, enhancer=None):
            store = create_store_(reducer, enhancer)
            dispatch = store['dispatch']
            middleware_api = {
                'get_state': store['get_state'],
                'dispatch': lambda action: dispatch(action),
            }
            chain = [mw(middleware_api) for mw in middlewares]
            dispatch = compose(*chain)(store['dispatch'])

            return extend(store, {'dispatch': dispatch})
        return create_wrapper
    return inner
871273
function () {
    var middlewares = Array.prototype.slice.apply(arguments)
      , req = middlewares.splice(0, 1)
      , next = middlewares.pop()
    
    // Check other middlewares for client objects. If we find one, merge
    // it and ours together.
    for (var i = 0; i < middlewares.length; i++) {
      var middleware_obj = middlewares[i]
      if (middleware_obj.type == 'client') {
        utils.merge(middlewares[i], hist_obj)
        return undefined
      }
    }
    
    // If we get this far, no other middlewares match client type. So pass
    // our middleware object.
    next({'history': hist_obj})
    return undefined
  }
916686
private function getStack()
    {
        $processed = [];

        foreach ($this->middlewareGenerator() as $middleware) {
            $processed[] = $middleware;
        }

        $middleware = array_reverse($processed);
        $stack = array_reduce($middleware, $this->getZipper(), $this->dispatcher);

        return $stack;
    }
1337305
def method_caller(method_name, *args, **kwargs):
	
	def call_method(target):
		func = getattr(target, method_name)
		return func(*args, **kwargs)
	return call_method
773737
function onlyFunctions(middleware) {
  if (!middleware || !Array.isArray(middleware)) {
    return [];
  }

  return middleware.filter(function (fn) {
    return typeof fn === 'function';
  });
}
711671
function(){
        var funcstring, stack = "";
        if (this.args) {
            var func = this.args.callee;
            while (func){
                funcstring = String(func);
                func = func.caller;
            }
        }
        return stack;
    }