gets a listing of middlewares
334745
function (uses, payload, message) {
        var results = [];
        var keys = (uses || []);
        for (var i = 0; i < forced.length; ++i) {
            if (keys.indexOf(forced[i]) === -1) {
                keys.push(forced[i]);
            }
        }

        for (var i = 0; i < keys.length; ++i) {
            if (middlewares[keys[i]] !== undefined) {
                results.push({
                    method: middlewares[keys[i]],
                    params: [payload, message]
                });
            }
        }

        return results;
    }
835095
def webserver_list():
    
    p = set(get_packages())
    w = set(['apache2','gunicorn','uwsgi','nginx'])
    installed = p & w
    return list(installed)
146330
def list_resourcepools(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_resourcepools function must be called with '
            '-f or --function.'
        )

    return {'Resource Pools': salt.utils.vmware.list_resourcepools(_get_si())}
91285
protected function orderMiddlewareByPriority(array $middleware): array
	{
		if(empty($this->middlewarePriority))
		{
			return $middleware;
		}

		$priority = array_intersect_key($this->middlewarePriority, $middleware) + array_fill_keys(array_keys(array_diff_key($middleware, $this->middlewarePriority)), static::MIDDLEWARE_DEFAULT_PRIORITY);

		// Sort the priority map using stable sorting

		$position = 0;

		foreach($priority as $key => $value)
		{
			$priority[$key] = [$position++, $value];
		}

		uasort($priority, function($a, $b)
		{
			return $a[1] === $b[1] ? ($a[0] > $b[0] ? 1 : -1) : ($a[1] > $b[1] ? 1 : -1);
		});

		foreach($priority as $key => $value)
		{
			$priority[$key] = $value[1];
		}

		// Return sorted middleware list

		return array_merge($priority, $middleware);
	}
512727
def add_middleware(self, middleware):
        """"""
        if self.middleware is None:
            self._middleware = []
        self.middleware.append(middleware)
1334851
function createDefaultMiddleware(connect, options) {
    var middlewares = [];
    if (!Array.isArray(options.base)) {
      options.base = [options.base];
    }
    var directory = options.directory || options.base[options.base.length - 1];
    options.base.forEach(function(base) {
      // Serve static files.
      middlewares.push(connect.static(base));
    });
    // Make directory browse-able.
    middlewares.push(connect.directory(directory));
    return middlewares;
  }
1250571
def listing(callback=None, path=None, method=Method.GET, resource=None, tags=None, summary="List resources",
            middleware=None, default_limit=50, max_limit=None, use_wrapper=True):
    # type: (Callable, Path, Methods, Resource, Tags, str, List[Any], int, int) -> Operation
    
    op_type = WrappedListOperation if use_wrapper else ListOperation

    def inner(c):
        op = op_type(c, path or NoPath, method, resource, tags, summary, middleware,
                     default_limit=default_limit, max_limit=max_limit)
        op.responses.add(Response(HTTPStatus.OK, "Listing of resources", Listing))
        return op
    return inner(callback) if callback else inner
448864
public function gatherMiddleware()
    {
        if (! is_null($this->computedMiddleware)) {
            return $this->computedMiddleware;
        }

        $this->computedMiddleware = [];

        return $this->computedMiddleware = array_unique(array_merge(
            $this->middleware(), $this->controllerMiddleware()
        ), SORT_REGULAR);
    }
739049
def list_apis(awsclient):
    """"""
    client_api = awsclient.get_client('apigateway')

    apis = client_api.get_rest_apis()['items']

    for api in apis:
        print(json2table(api))
437486
def list_aggregated_resources(uri_prefix, opts = {})
      data, _status_code, _headers = list_aggregated_resources_with_http_info(uri_prefix, opts)
      return data
    end
171351
def list_backends(_):
    """"""
    backends = [b.__name__ for b in available_backends()]
    print('\n'.join(backends))
609838
function (routerMiddelware, req, res, next) {
		var middlewareFilename = routerMiddelware.split('.')[0];
		var middlewareFunction = routerMiddelware.split('.')[1];

		if (!req.pipa) req.pipa = {};

		this.middlewares[middlewareFilename][middlewareFunction](req, res, function (data) {
			_.extend(req.pipa, data); next();
		});
	}
431654
public function sortMiddleware( $middleware ) {
		$sorted = $middleware;

		usort( $sorted, function ( $a, $b ) use ( $middleware ) {
			$a_priority = $this->getMiddlewarePriorityForMiddleware( $a );
			$b_priority = $this->getMiddlewarePriorityForMiddleware( $b );
			$priority = $b_priority - $a_priority;

			if ( $priority !== 0 ) {
				return $priority;
			}

			// Keep relative order from original array.
			return array_search( $a, $middleware ) - array_search( $b, $middleware );
		} );

		return array_values( $sorted );
	}
419286
public static function addStaticMiddlewares(...$middlewares): array
    {
        $stack = static::getStaticMiddlewareStack(true);
        foreach ($middlewares as $middleware) {
            $stack->append($middleware);
        }
        return $middlewares;
    }
581517
def get_servers_list(self):
        
        ret = []

        if self.args.browser:
            ret = self.static_server.get_servers_list()
            if self.autodiscover_server is not None:
                ret = self.static_server.get_servers_list() + self.autodiscover_server.get_servers_list()

        return ret
748172
public function getMiddlewares(array $middlewares = []) : array
	{
		return $this->parent ? 
			$this->parent->getMiddlewares(array_merge($middlewares, $this->middlewares)) :
			array_merge($middlewares, $this->middlewares);
	}
627513
protected function getMiddlewareHandlers(\Owl\Http\Request $request)
    {
        if (!$this->middleware_handlers) {
            return [];
        }

        $request_path = $this->getRequestPath($request);

        $result = [];
        foreach ($this->middleware_handlers as $path => $handlers) {
            if (strpos($request_path, $path) === 0) {
                $result = array_merge($result, $handlers);
            }
        }

        return $result;
    }