Ref : https://github.com/nikic/FastRoute/issues/66#issuecomment-130395124
3158
protected function generateDataList($namedRoute, array $list = []): string
    {
        $routes = $this->parseRoutePattern($namedRoute);

        foreach ($routes as $route) {
            $url = '';
            $paramIdx = 0;
            foreach ($route as $part) {
                if (is_string($part)) {
                    $url .= $part;
                    continue;
                }

                if ($paramIdx === count($list)) {
                    throw new Exception('Not enough parameters given');
                }
                $url .= $list[$paramIdx++];
            }

            if ($paramIdx === count($list)) {
                return $url;
            }
        }

        throw new Exception('Too many parameters given');
    }
796518
function getRoute(route) {
                for (var key in settings.routes) {
                    if (key === route) {
                        return settings.routes[key];
                    }
                }
            }
757916
def _route(self, attr, args, kwargs, **fkwargs):
        
        key = get_key(args, kwargs)

        return [crc32(str(key)) % len(self.cluster)]
533801
async function _default(config, routesConfig) {
  const res = await (0, _startApp.default)(config);
  const {
    url,
    app,
    router,
    middleware,
    connect
  } = res;
  let methods;

  if (routesConfig) {
    methods = await (0, _routes.initRoutes2)(routesConfig, middleware, router);
    const routes = router.routes();
    app.use(routes);
  }

  return {
    url,
    app,
    connect,
    methods,
    router
  };
}
381563
function (data, routes) {
		var tempRoutes = {};

		data.forEach(function (r) {
			if (r && r.routes) {
				for (var key in r.routes) {
					if (key && r.routes[key] && !routes[r.rootApiPath + '/' + key])
						routes[r.rootApiPath + '/' + key] = r.routes[key]
				}
			}
		});
	}
379659
function buildRoute(
  name,
  position,
  { NatGatewayId = null, GatewayId = null, InstanceId = null } = {},
) {
  const route = {
    Type: 'AWS::EC2::Route',
    Properties: {
      DestinationCidrBlock: '0.0.0.0/0',
      RouteTableId: {
        Ref: `${name}RouteTable${position}`,
      },
    },
  };

  if (NatGatewayId) {
    route.Properties.NatGatewayId = {
      Ref: NatGatewayId,
    };
  } else if (GatewayId) {
    route.Properties.GatewayId = {
      Ref: GatewayId,
    };
  } else if (InstanceId) {
    route.Properties.InstanceId = {
      Ref: InstanceId,
    };
  } else {
    throw new Error(
      'Unable to create route: either NatGatewayId, GatewayId or InstanceId must be provided',
    );
  }

  const cfName = `${name}Route${position}`;
  return {
    [cfName]: route,
  };
}
850384
function ActivatedRoute(url, params, queryParams, fragment, data, outlet, component, futureSnapshot) {
        this.url = url;
        this.params = params;
        this.queryParams = queryParams;
        this.fragment = fragment;
        this.data = data;
        this.outlet = outlet;
        this.component = component;
        this._futureSnapshot = futureSnapshot;
    }
1252256
function addOptionRoute(routeConfig, routeKey) {
    var tmp = routeKey.split(/\s+/);
    var path = '';
    if (tmp.length > 1) {
        path = tmp[1];
    } else {
        path = routeKey;
    }

    routeConfig['options ' + path] = function(request, response, next) {
        enableCors(request, response);
        response.sendStatus(200);
    };
}
640416
function defineRoute (server, opts) {

    server.route({
        method: 'GET',
        path: '/bomb',
        handler: handler,
        config: {
            jsonp: 'callback',
            validate: {
                query: {
                    count: Hapi.types.Number()
                },
                payload: false
            }
        }
    });

    function handler (req) {
        var count = (req.query.count || opts.defaultBombCount);
        var res = {};
        res[opts.plural] = _.sample(opts.things, count);
        req.reply(res);
    }

}
949055
def insert_route(self, path, data, destroy_data_fn):
        
        return lib.ztrie_insert_route(self._as_parameter_, path, data, destroy_data_fn)
737384
function _buildRoute(route) {

  let newRoute = route;

  // Normalize the route string
  newRoute = (newRoute.indexOf('/') === 0) ? newRoute.slice(1, newRoute.length) : newRoute;
  newRoute = '/' + newRoute;

  // Prepend the root if the user defined one
  newRoute = (Nasa.__config__['root']) ? Nasa.__config__['root'] + newRoute : newRoute;

  return newRoute;
}
874778
def routingAreaUpdateReject():
    """"""
    a = TpPd(pd=0x3)
    b = MessageType(mesType=0xb)  # 00001011
    c = GmmCause()
    d = ForceToStandbyAndSpareHalfOctets()
    packet = a / b / c / d
    return packet
1093987
function preloadRoute(json, router, controllers) {
  // 支持 '/router get func' 这种配置
  if (isString(json)) {
    let arr = json.split(/\s+/);
    const obj = {};
    obj.path = arr[0];
    switch (arr.length) {
      case 2:
        obj.controller = arr[1];
        break;
      case 3:
        obj.method = arr[1];
        obj.controller = arr[2];
        break;
    }
    json = obj;
  }
  if (isUndefined(json.path)) {
    forEach(json, (val, key) => _preloadRoute(adaptForRouter(val, key), router, controllers));
  } else {
    _preloadRoute(json, router, controllers);
  }
}
182096
function () {
		var self = this;
		var routes;

		this.getRouteFromDirectory(this.routeBasePath(), function (err, dataRoute) {
			if (err) return console.dir(err);

			routes = dataRoute.routes;

			if (dataRoute.dirs && dataRoute.dirs.length > 0) {
				var listRouteFromDir = [];

				dataRoute.dirs.forEach(function (dir) {
					if (dir) listRouteFromDir.push(function (cb) { self.getRouteFromDirectory(self.routeBasePath() + '/' + dir, dir, cb); });
				});

				async.parallel(listRouteFromDir, function (err, asyncData){
					if (err) return console.dir(err);

					listRouteFromDir = [];

					if (asyncData.length > 0) {
						asyncData.forEach(function (data) {
							data.dirs.forEach(function (dir) {
								if (dir)
									listRouteFromDir.push(function (cb) {
										self.getRouteFromDirectory(data.pathDir + '/' + dir, data.rootApiPath + '/' + dir, cb);
									});
							});
						});

						async.parallel(listRouteFromDir, function (err, asyncDataVer){
							if (err) return console.dir(err);

							self.setTempRoutes(asyncData, routes);
							self.setTempRoutes(asyncDataVer, routes);
							self.__init__middleware(routes);
						});
					}
				});
			} else {
				self.__init__middleware(routes);
			}
		});
	}
380742
function (fragment, callback) {

            var routeExecutionStack = [];

            for (var i = 0; i < this.$routers.length; i++) {
                routeExecutionStack = routeExecutionStack.concat(this.$routers[i].generateRoutingStack(fragment));
            }

            if (routeExecutionStack.length === 0) {
                this.routeNotFound(fragment, callback);
            } else {
                flow()
                    .seqEach(routeExecutionStack, function(routingFunction, cb){
                        routingFunction(cb);
                    })
                    .exec(callback);
            }
        }
285786
private function getRoutesFromIndex (&$routes, &$routesIndex, &$requestMethod, &$requestPathParts, $requestPathIndex = 0) {
        if (!empty($requestPathParts[$requestPathIndex])) {
            $requestPathPart = $requestPathParts[$requestPathIndex];
            if (array_key_exists($requestPathPart, $routesIndex)) {
                $this->getRoutesFromIndex($routes,$routesIndex[$requestPathPart], $requestMethod, $requestPathParts, $requestPathIndex + 1);
            }
            if (array_key_exists(self::ROUTE_PARAMETER_WILDCARD, $routesIndex)) {
                $this->getRoutesFromIndex($routes,$routesIndex[self::ROUTE_PARAMETER_WILDCARD], $requestMethod, $requestPathParts, $requestPathIndex + 1);
            }
        }
        else if (array_key_exists(self::ROUTE_ACTIONS_KEY, $routesIndex)) {
            $testRoutes = &$routesIndex[self::ROUTE_ACTIONS_KEY];
            if (array_key_exists($requestMethod, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[$requestMethod], $requestMethod,$requestPathParts);
            }
            if (array_key_exists(self::ROUTE_GENERIC_METHOD, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[self::ROUTE_GENERIC_METHOD], $requestMethod, $requestPathParts);
            }
        }

        if (array_key_exists(self::ROUTE_GENERIC_ACTIONS_KEY, $routesIndex)) {
            $testRoutes = &$routesIndex[self::ROUTE_GENERIC_ACTIONS_KEY];
            if (array_key_exists($requestMethod, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[$requestMethod], $requestMethod, $requestPathParts);
            }
            if (array_key_exists(self::ROUTE_GENERIC_METHOD, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[self::ROUTE_GENERIC_METHOD], $requestMethod, $requestPathParts);
            }
        }
    }
432794
protected function bootstrapDispatcher(): void
    {
        $this->routeDispatcher = FastRoute\simpleDispatcher(function (RouteCollector $collector) {
            foreach ($this->routes as $routeName => $route) {
                $collector->addRoute($route['method'], $route['pattern'], $route['handler']);
            }
        });
    }