Generate the list of URL patterns including the registered single
        object routers urls.
354314
def get_urls(self):
        
        base_urls = super(SimpleRouter, self).get_urls()
        single_urls = sum([r.urls for r in self._single_object_registry], [])
        nested_urls = sum([r.urls for r in self._nested_object_registry], [])

        return base_urls + single_urls + nested_urls
267649
def _generate_url_root(protocol, host, port):
        
        return URL_ROOT_PATTERN.format(protocol=protocol, host=host, port=port)
577018
def selected_urls(self):
        
        urls = []
        debug('gettings urls')
        for proxy_index in self.tree_view.selectedIndexes():
            finfo = self.tree_view.fileInfo(proxy_index)
            urls.append(finfo.canonicalFilePath())
        debug('selected urls %r' % [str(url) for url in urls])
        return urls
1158911
private List<String> buildUrls(List<String> references) {
		List<String> urls = new ArrayList<String>(references.size());
		for (String url : references) {
			if (url.toUpperCase().startsWith("RFC")) {
				url = RFC_REFERENCE_BASE_URL + url;
			} else if (url.startsWith("http")) {
				// already an URL so do nothing
			} else {
				url = MIME_TYPE_REFERENCE_BASE_URL + "#" + url;
			}
			urls.add(url);
		}
		return urls;
	}
1164798
def get_urlpatterns(self):
        
        return [
            path(_('topics/'), self.latest_topics_feed(), name='latest_topics'),
            path(
                _('forum/<str:forum_slug>-<int:forum_pk>/topics/'),
                self.latest_topics_feed(),
                name='forum_latest_topics',
            ),
            path(
                _('forum/<str:forum_slug>-<int:forum_pk>/topics/all/'),
                self.latest_topics_feed(),
                {'descendants': True},
                name='forum_latest_topics_with_descendants',
            ),
        ]
233804
def http_methods(self, urls=None, **route_data):
        """"""
        def decorator(class_definition):
            instance = class_definition
            if isinstance(class_definition, type):
                instance = class_definition()

            router = self.urls(urls if urls else "/{0}".format(instance.__class__.__name__.lower()), **route_data)
            for method in HTTP_METHODS:
                handler = getattr(instance, method.lower(), None)
                if handler:
                    http_routes = getattr(handler, '_hug_http_routes', ())
                    if http_routes:
                        for route in http_routes:
                            http(**router.accept(method).where(**route).route)(handler)
                    else:
                        http(**router.accept(method).route)(handler)

                    cli_routes = getattr(handler, '_hug_cli_routes', ())
                    if cli_routes:
                        for route in cli_routes:
                            cli(**self.where(**route).route)(handler)
            return class_definition
        return decorator
1263122
def handlers(self):
        """"""
        used = []
        for base_url, mapping in self.routes.items():
            for url, methods in mapping.items():
                for method, versions in methods.items():
                    for version, handler in versions.items():
                        if not handler in used:
                            used.append(handler)
                            yield handler
1144910
public static List<Pattern> getNoProxyHostPatterns(String noProxyHost) {
        if (noProxyHost==null)  return Collections.emptyList();

        List<Pattern> r = Lists.newArrayList();
        for (String s : noProxyHost.split("[ \t\n,|]+")) {
            if (s.length()==0)  continue;
            r.add(Pattern.compile(s.replace(".", "\\.").replace("*", ".*")));
        }
        return r;
    }
716677
def get_routing_tuples(cls):
        ''''''
        for callback in cls.callbacks:
            ep_name = '{}.{}'.format(cls.api.__name__, callback.__name__)
            yield (Rule(cls.endpoint_path,
                        endpoint=ep_name,
                        methods=callback.swagger_ops),
                   callback)
110004
def make_router(*routings):
    
    routes = []
    for routing in routings:
        methods, regex, app = routing[:3]
        if isinstance(methods, basestring):
            methods = (methods,)
        vars = routing[3] if len(routing) >= 4 else {}
        routes.append((methods, re.compile(unicode(regex)), app, vars))

    def router(environ, start_response):
        """Dispatch request to controllers."""
        req = webob.Request(environ)
        split_path_info = req.path_info.split('/')
        if split_path_info[0]:
            # When path_info doesn't start with a "/" this is an error or a attack => Reject request.
            # An example of an URL with such a invalid path_info: http://127.0.0.1http%3A//127.0.0.1%3A80/result?...
            ctx = contexts.Ctx(req)
            headers = wsgihelpers.handle_cross_origin_resource_sharing(ctx)
            return wsgihelpers.respond_json(ctx,
                dict(
                    apiVersion = 1,
                    error = dict(
                        code = 400,  # Bad Request
                        message = ctx._(u"Invalid path: {0}").format(req.path_info),
                        ),
                    ),
                headers = headers,
                )(environ, start_response)
        for methods, regex, app, vars in routes:
            match = regex.match(req.path_info)
            if match is not None:
                if methods is not None and req.method not in methods:
                    ctx = contexts.Ctx(req)
                    headers = wsgihelpers.handle_cross_origin_resource_sharing(ctx)
                    return wsgihelpers.respond_json(ctx,
                        dict(
                            apiVersion = 1,
                            error = dict(
                                code = 405,
                                message = ctx._(u"You cannot use HTTP {} to access this URL. Use one of {}.").format(
                                    req.method, methods),
                                ),
                            ),
                        headers = headers,
                        )(environ, start_response)
                if getattr(req, 'urlvars', None) is None:
                    req.urlvars = {}
                req.urlvars.update(match.groupdict())
                req.urlvars.update(vars)
                req.script_name += req.path_info[:match.end()]
                req.path_info = req.path_info[match.end():]
                return app(req.environ, start_response)
        ctx = contexts.Ctx(req)
        headers = wsgihelpers.handle_cross_origin_resource_sharing(ctx)
        return wsgihelpers.respond_json(ctx,
            dict(
                apiVersion = 1,
                error = dict(
                    code = 404,  # Not Found
                    message = ctx._(u"Path not found: {0}").format(req.path_info),
                    ),
                ),
            headers = headers,
            )(environ, start_response)

    return router
304939
def _BuildHttpRoutingMap(self, router_cls):
    """"""

    if not issubclass(router_cls, api_call_router.ApiCallRouter):
      raise ValueError("Router has to be an instance of ApiCallRouter.")

    routing_map = routing.Map()
    # Note: we traverse methods of the base class (ApiCallRouter) to avoid
    # potential problems caused by child router classes using the @Http
    # annotation (thus adding additional unforeseen HTTP paths/methods). We
    # don't want the HTTP API to depend on a particular router implementation.
    for _, metadata in iteritems(router_cls.GetAnnotatedMethods()):
      for http_method, path, unused_options in metadata.http_methods:
        routing_map.add(
            routing.Rule(path, methods=[http_method], endpoint=metadata))
        # This adds support for the next version of the API that uses
        # standartized JSON protobuf serialization.
        routing_map.add(
            routing.Rule(
                path.replace("/api/", "/api/v2/"),
                methods=[http_method],
                endpoint=metadata))

    return routing_map
383453
private List<String> getPatterns(List<NumberPattern> patterns) {
    return patterns.stream()
        .map(p -> p.render())
        .collect(Collectors.toList());
  }
1294643
public static String getUrlMapping(String url, Map<String, String> urlMappings) {
        if (urlMappings != null) {
            for (String pattern : urlMappings.keySet()) {
                if (urlMatcher.match(pattern, url)) {
                    return urlMappings.get(pattern);
                }
            }
        }
        
        return null;
    }
223712
def _generate_routes_m(self, namespace):
        """"""
        with self.block_m(
                fmt_routes_class(namespace.name, self.args.auth_type)):
            init_args = fmt_func_args_declaration([(
                'client', 'id<{}>'.format(self.args.transport_client_name))])

            with self.block_func(
                    func='init', args=init_args, return_type='instancetype'):
                self.emit('self = [super init];')
                with self.block_init():
                    self.emit('_client = client;')
            self.emit()
            style_to_request = json.loads(self.args.z__style_to_request)

            for route in namespace.routes:
                if (route.attrs.get('auth') != self.args.auth_type
                        and route.attrs.get('auth') != 'noauth'):
                    continue

                route_type = route.attrs.get('style')
                client_args = json.loads(self.args.client_args)

                if route_type in client_args.keys():
                    for args_data in client_args[route_type]:
                        task_type_key, type_data_dict = tuple(args_data)
                        task_type_name = style_to_request[task_type_key]

                        func_suffix = type_data_dict[0]
                        extra_args = [
                            tuple(type_data[:-1])
                            for type_data in type_data_dict[1]
                        ]

                        if (is_struct_type(route.arg_data_type) and
                                self._struct_has_defaults(route.arg_data_type)):
                            route_args, _ = self._get_default_route_args(
                                namespace, route)
                            self._generate_route_m(route, namespace,
                                                   route_args, extra_args,
                                                   task_type_name, func_suffix)

                        route_args, _ = self._get_route_args(namespace, route)
                        self._generate_route_m(route, namespace, route_args,
                                               extra_args, task_type_name,
                                               func_suffix)
                else:
                    task_type_name = style_to_request[route_type]
                    if (is_struct_type(route.arg_data_type) and
                            self._struct_has_defaults(route.arg_data_type)):
                        route_args, _ = self._get_default_route_args(
                            namespace, route)
                        self._generate_route_m(route, namespace, route_args,
                                               [], task_type_name, '')

                    route_args, _ = self._get_route_args(namespace, route)
                    self._generate_route_m(route, namespace, route_args, [],
                                           task_type_name, '')
1133292
def _urls(self):
        """"""
        urlpatterns = self._get_default_urlpatterns()
        self._autodiscover()

        # Discover each dashboard's panels.
        for dash in self._registry.values():
            dash._autodiscover()

        # Load the plugin-based panel configuration
        self._load_panel_customization()

        # Allow for override modules
        if self._conf.get("customization_module", None):
            customization_module = self._conf["customization_module"]
            bits = customization_module.split('.')
            mod_name = bits.pop()
            package = '.'.join(bits)
            mod = import_module(package)
            try:
                before_import_registry = copy.copy(self._registry)
                import_module('%s.%s' % (package, mod_name))
            except Exception:
                self._registry = before_import_registry
                if module_has_submodule(mod, mod_name):
                    raise

        # Compile the dynamic urlconf.
        for dash in self._registry.values():
            urlpatterns.append(url(r'^%s/' % dash.slug,
                                   _wrapped_include(dash._decorated_urls)))

        # Return the three arguments to django.conf.urls.include
        return urlpatterns, self.namespace, self.slug
559292
def urls(self):
        
        url_bases = self._url_module.url_bases
        unformatted_paths = self._url_module.url_paths

        urls = {}
        for url_base in url_bases:
            for url_path, handler in unformatted_paths.items():
                url = url_path.format(url_base)
                urls[url] = handler

        return urls
611043
def get_routes(self, viewset):
        

        known_actions = list(flatten([route.mapping.values() for route in self.routes if isinstance(route, Route)]))

        # Determine any `@detail_route` or `@list_route` decorated methods on the viewset
        detail_routes = []
        list_routes = []

        for methodname in dir(viewset):
            attr = getattr(viewset, methodname)
            httpmethods = getattr(attr, 'bind_to_methods', None)
            detail = getattr(attr, 'detail', True)

            if httpmethods:
                # check against know actions list
                if methodname in known_actions:
                    raise ImproperlyConfigured('Cannot use @detail_route or @list_route '
                                               'decorators on method "%s" '
                                               'as it is an existing route'.format(methodname))

                httpmethods = [method.lower() for method in httpmethods]

                if detail:
                    detail_routes.append((httpmethods, methodname))
                else:
                    list_routes.append((httpmethods, methodname))

        def _get_dynamic_routes(route, dynamic_routes):
            ret = []

            for httpmethods, methodname in dynamic_routes:
                method_kwargs = getattr(viewset, methodname).kwargs
                initkwargs = route.initkwargs.copy()
                initkwargs.update(method_kwargs)
                url_path = initkwargs.pop("url_path", None) or methodname

                ret.append(Route(
                    url=replace_methodname(route.url, url_path),
                    mapping={httpmethod: methodname for httpmethod in httpmethods},
                    name=replace_methodname(route.name, url_path),
                    initkwargs=initkwargs,
                ))

            return ret

        ret = []

        for route in self.routes:
            if isinstance(route, DynamicDetailRoute):
                # Dynamic detail routes (@detail_route decorator)
                ret += _get_dynamic_routes(route, detail_routes)
            elif isinstance(route, DynamicListRoute):
                # Dynamic list routes (@list_route decorator)
                ret += _get_dynamic_routes(route, list_routes)
            else:
                # Standard route
                ret.append(route)

        return ret