DREST routes injection, overrides DRF's get_routes() method, which
        gets called for each registered viewset.
436311
def get_routes(self, viewset):
        
        routes = super(DynamicRouter, self).get_routes(viewset)
        routes += self.get_relation_routes(viewset)
        return routes
996341
def _generate_route_keys(self, methods, path):
        
        for method in methods:
            yield self._route_key(method, path)
668730
def routes(cls, application=None):
        
        if application:
            for route in cls._routes:
                application.add_handlers(route['host'], route['spec'])
        else:
            return [route['spec'] for route in cls._routes]
1364944
private function filterByMethodAndScheme(RouteCollectionInterface $routes, Request $context)
    {
        return $routes->findByMethod($context->getMethod())->findByScheme($context->getScheme());
    }
1040174
def route(view, endpoint=None, methods=None, defaults=None, **options):
    
    if not endpoint:
        endpoint = view
    if not methods:
        methods = ['GET']
    return dict(
        view_func=LazyView(view),
        endpoint=endpoint,
        methods=methods,
        defaults=defaults,
        **options
    )
150605
function bindRoutes (app, opts) {

    // Main test page
    app.get('/', function (req, res) {
        renderTmpl(__dirname + '/../view/index.html', opts, function (err, content) {
            res.send(content);
        });
    });

}
871781
public function viewRoutes()
	{
		// variables
		$routes = \Route::getRoutes();
		$array  = [];
		foreach ($routes as /** @var Route */ $route)
		{
			// properties
			$methods = method_exists($route, 'getMethods') ? $route->getMethods() : $route->methods;
			$uri = method_exists($route, 'getUri') ? $route->getUri() : $route->uri;
			$action = $route->getAction()['uses'];

			// data
			$array[] =
			[
				'methods'   => implode('|', $methods),
				'uri'       => $uri,
				'name'      => $route->getName(),
				'action'    => $action instanceof \Closure ? 'Closure' : $action,
				'middleware'=> implode(', ', $route->middleware()),
			];
		}

		vue('sketchpad::help/tools/routes', $array);
	}
474640
def get_urls(self, **kwargs):
        
        kwargs["site"] = Site.objects.get(id=current_site_id())
        return super(DisplayableSitemap, self).get_urls(**kwargs)
595572
public void withRoutes(MangooRoute... routes) {
        Objects.requireNonNull(routes, Required.ROUTE.toString());
        
        for (MangooRoute route : routes) {
            RequestRoute requestRoute = (RequestRoute) route;
            requestRoute.withControllerClass(this.controllerClass);

            if (hasBasicAuthentication()) {
                requestRoute.withBasicAuthentication(this.username, this.password, this.secret);
            }
            
            if (hasAuthentication()) {
                requestRoute.withAuthentication();
            }
            
            if (hasAuthorization()) {
                requestRoute.withAuthorization();
            }
            
            if (hasBlocking()) {
                requestRoute.withNonBlocking();
            }
            
            if (requestRoute.getLimit() == 0) {
                requestRoute.withRequestLimit(this.limit);
            }
            
            if (requestRoute.hasMultipleMethods()) {
                for (Http method : requestRoute.getMethods()) {
                    requestRoute.withHttpMethod(method);
                    Router.addRoute(requestRoute);
                }
            } else {
                Router.addRoute(requestRoute);
            }
        }
    }
923874
function transformRoutes(routes) {
  if (typeof routes !== 'object') {
    throw new Error('Invalid route config');
  }
  var config = clone(routes);

  return Object.keys(config).map(function(name){
    var opt = config[name];
    // sugar for specifying fn
    if (typeof opt === 'function') {
      opt = {
        view: opt
      };
    } else if (typeof opt !== 'object') {
      throw new Error('Invalid route config for ' + name);
    }

    var defaultRoute = opt.defaultChild ? DefaultRoute({
      key: (opt.defaultChild.key || name + 'Default'),
      name: (opt.defaultChild.name || name + 'Default'),
      handler: opt.defaultChild.view
    }) : null;

    var notFoundRoute = opt.childNotFound ? NotFoundRoute({
      key: (opt.childNotFound.key || name + 'NotFound'),
      name: (opt.childNotFound.name || name + 'NotFound'),
      handler: opt.childNotFound.view
    }) : null;

    var children = (opt.children ? transformRoutes(opt.children) : []);
    if (defaultRoute) {
      children.push(defaultRoute);
    }
    if (notFoundRoute) {
      children.push(notFoundRoute);
    }
    return Route({
      key: name,
      name: name,
      path: opt.path,
      handler: opt.view
    }, children);
  });
}
681211
private static <T> void aggregateRoutes(
		String method, Map<PathPattern, T> routes,
		List<String> accMethods, List<String> accPatterns, List<String> accTargets) {
		for (Map.Entry<PathPattern, T> entry : routes.entrySet()) {
			accMethods.add(method);
			accPatterns.add("/" + entry.getKey().pattern());
			accTargets.add(targetToString(entry.getValue()));
		}
	}
668668
def get_serializer_fields(self, path, method, view, version=None, method_func=None):
        
        if method in ('PUT', 'PATCH', 'POST'):
            location = 'form'
        else:
            location = 'query'

        serializer_class = self.get_serializer_class(view, method_func)
        if not serializer_class:
            return []

        serializer = serializer_class()
        if isinstance(serializer, serializers.ListSerializer):
            return [
                Field(
                    name='data',
                    location=location,
                    required=True,
                    schema=coreschema.Array()
                )
            ]

        if not isinstance(serializer, serializers.Serializer):
            return []

        fields = []
        for field in serializer.fields.values():
            if field.read_only or isinstance(field, serializers.HiddenField):
                continue

            required = field.required and method != 'PATCH'
            # if the attribute ('help_text') of this field is a lazy translation object, force it to generate a string
            description = str(field.help_text) if isinstance(field.help_text, Promise) else field.help_text
            fallback_schema = self.fallback_schema_from_field(field)
            field = Field(
                name=field.field_name,
                location=location,
                required=required,
                schema=fallback_schema if fallback_schema else field_to_schema(field),
                description=description,
            )
            fields.append(field)

        return fields
823895
def get_queryset(self, request):
        
        qs = super(UnrenderedAdmin, self).get_queryset(request)
        if 'show_rendered' in qs.query.context:
            del qs.query.context['show_rendered']
        return qs
859632
public void setRoutes(java.util.Collection<RouteRef> routes) {
        if (routes == null) {
            this.routes = null;
            return;
        }

        this.routes = new java.util.ArrayList<RouteRef>(routes);
    }
619647
def infer_resource_routes(routes)
      resource_routes = []

      resource_routes << :index if routes.include?(:index)
      resource_routes << :show if routes.include?(:show)

      resource_routes
    end
851039
def filter_queryset(self, request, queryset, view):
        
        # Check if this is a list type request
        if view.lookup_field not in view.kwargs:
            if not self.action_routing:
                return self.filter_list_queryset(request, queryset, view)
            else:
                method_name = "filter_{action}_queryset".format(action=view.action)
                return getattr(self, method_name)(request, queryset, view)
        return queryset
606214
private void registerControllerMethods(Map<Method, Class<? extends Annotation>> discoveredMethods) {

        Collection<Method> methods = sortMethods(discoveredMethods.keySet());

        Map<Class<? extends Controller>, Set<String>> controllers = new HashMap<>();
        for (Method method : methods) {
            Class<? extends Controller> controllerClass = (Class<? extends Controller>) method.getDeclaringClass();
            if (!controllers.containsKey(controllerClass)) {
                Set<String> paths = collectPaths(controllerClass);
                controllers.put(controllerClass, paths);
            }

            Class<? extends Annotation> httpMethodAnnotationClass = discoveredMethods.get(method);
            Annotation httpMethodAnnotation = method.getAnnotation(httpMethodAnnotationClass);

            String httpMethod = httpMethodAnnotation.annotationType().getAnnotation(HttpMethod.class).value();
            String[] methodPaths = ClassUtil.executeDeclaredMethod(httpMethodAnnotation, "value");

            Set<String> controllerPaths = controllers.get(controllerClass);
            if (controllerPaths.isEmpty()) {
                // add an empty string to allow controllerPaths iteration
                controllerPaths.add("");
            }

            for (String controllerPath : controllerPaths) {

                if (methodPaths.length == 0) {
                    // method does not specify a path, inherit from controller
                    String fullPath = StringUtils.addStart(StringUtils.removeEnd(controllerPath, "/"), "/");
                    ControllerHandler handler = new ControllerHandler(injector, controllerClass, method.getName());
                    handler.validateMethodArgs(fullPath);

                    RouteRegistration registration = new RouteRegistration(httpMethod, fullPath, handler);
                    configureRegistration(registration, method);
                    routeRegistrations.add(registration);
                } else {
                    // method specifies one or more paths, concatenate with controller paths
                    for (String methodPath : methodPaths) {
                        String path = Joiner.on("/").skipNulls().join(StringUtils.removeEnd(controllerPath, "/"), StringUtils.removeStart(methodPath, "/"));
                        String fullPath = StringUtils.addStart(StringUtils.removeEnd(path, "/"), "/");

                        ControllerHandler handler = new ControllerHandler(injector, controllerClass, method.getName());
                        handler.validateMethodArgs(fullPath);

                        RouteRegistration registration = new RouteRegistration(httpMethod, fullPath, handler);
                        configureRegistration(registration, method);
                        routeRegistrations.add(registration);
                    }
                }

            }

        }
    }