returns an object with the members: routeIndex - the first index of routes that matches the passed pathIndex pathIndex - the path index corrected for where the beggining of the divergence route is
482391
function routeAndCorrectedPathIndexes(routes, pathIndex) {
        for(var n=0; n<routes.length; n++) {
            var pathIndexes = routes[n].pathIndexes
            if(pathIndexes.start <= pathIndex && pathIndex <= pathIndexes.end || routes[n].route.isDefault) {
                return {routeIndex: n, pathIndex: pathIndexes.start}
            }
        }
        // else
        return {routeIndex: routes.length, pathIndex: pathIndex}
    }
1324330
function traverseRoute(that, route, pathSegment, pathIndexOffset) {

        var handlerParameters = []
        var matchingRouteInfo;
        for(var i=0; i<route.routes.length; i++) {
            var info = route.routes[i]

            var transformedPathSegment = info.pathSegment//getPathSegmentFromInput(that.transform, info.pathSegment)
            if(!(transformedPathSegment instanceof Array))
                transformedPathSegment = [transformedPathSegment]

            var matchConsumed = match(transformedPathSegment, pathSegment)
            if(matchConsumed !== undefined) {
                matchingRouteInfo = {handler: info.handler, consumed: matchConsumed, pathSegment: pathSegment.slice(0,matchConsumed)}
                for(var n=0; n<transformedPathSegment.length; n++) {
                    if(transformedPathSegment[n] === Router.param) {
                        handlerParameters.push(pathSegment[n])
                    }
                }
                break;
            }
        }

        var runningDefault = false
        if(matchingRouteInfo === undefined) {
            if(pathSegment.length === 0) {
                return []; // done
            } else if(route.defaultHandler !== undefined) {
                getMatchingInfoForDefault()
            } else {
                return undefined // no default and no match!
            }
        }

        var consumed = matchingRouteInfo.consumed
        var subroute = new Route(matchingRouteInfo.pathSegment, that.transform, runningDefault)
        matchingRouteInfo.handler.apply(subroute, handlerParameters)

        if(runningDefault) { // if running a default handler
            var rest = []
        } else {
            var rest = traverseRoute(that, subroute, pathSegment.slice(consumed), pathIndexOffset+consumed)
        }

        if(rest === undefined) {
            // since there wasn't a full match in the child route, do the default route

            if(route.defaultHandler !== undefined) {
                getMatchingInfoForDefault()
                consumed = matchingRouteInfo.consumed
                subroute = new Route(matchingRouteInfo.pathSegment, that.transform, true)
                matchingRouteInfo.handler.apply(subroute, handlerParameters)
                rest = []
            } else {
                return undefined // no default and no match!
            }
        }

        var pathIndexEnd = pathIndexOffset+consumed
        if(consumed !== 0) {
            pathIndexEnd--
        }
        return [{route: subroute, pathIndexes: {start:pathIndexOffset, end: pathIndexEnd}}].concat(rest)


        function getMatchingInfoForDefault() {
            matchingRouteInfo = {handler: route.defaultHandler, consumed: pathSegment.length, pathSegment: pathSegment} // default handler consume the whole path - can't have subroutes
            runningDefault = true
            handlerParameters.push(getPathSegementToOutput(that.transform, pathSegment))
        }
    }
1337117
function getAllRoutes (router) {
  assert.equal(typeof router, 'function', 'wayfarer.getAllRoutes: router should be an function')

  var trie = router._trie
  assert.equal(typeof trie, 'object', 'wayfarer.getAllRoutes: trie should be an object')

  var tree = trie.trie
  return transform(tree)
}
694780
function getMatchedRoute(children, pathname) {
  return React.Children.toArray(children).find(child => {
    return matchPath(pathname, {
      exact: child.props.exact,
      path: child.props.path,
    });
  }) || NO_MATCH;
}
295746
def find_nearest_route(path)
			path_parts = path.parts.dup
			loop do
				route = routes.navigate(*path_parts)&.values&.grep(Route)&.first
				break route if route || path_parts.pop.nil?
			end
		end
709095
def path(self, goal):
        
        if goal == self.name:
            return [self]

        if goal not in self.routes:
            raise ValueError("Unknown '{0}'".format(goal))

        obj = self
        path = [obj]
        while True:
            obj = obj.routes[goal].direction
            path.append(obj)
            if obj.name == goal:
                break
        return path
252262
def _indices(self):
        """"""
        path = self.parent
        layer = path.parent
        for path_index in range(len(layer.paths)):
            if path == layer.paths[path_index]:
                for node_index in range(len(path.nodes)):
                    if self == path.nodes[node_index]:
                        return Point(path_index, node_index)
        return None
668036
def get_index_node(self, idx):
        ''''''
        idx = self.node_index.index(idx)
        return self.nodes[idx]
100476
def pathFromIndex(self, index):
        
        out  = []
        while index and index.isValid():
            out.append(nativestring(unwrapVariant(index.data())))
            index = self._model.parent(index)
        
        return self.joiner().join(reversed(out))
918946
def path(self, which=None):
        
        if which in ('refresh',):
            return '{0}/{1}'.format(
                super(SmartProxy, self).path(which='self'),
                which
            )
        return super(SmartProxy, self).path(which)
822761
def get_all(self, routes):
        
        for route in routes:
            self.load(route)

        return {name: value[1] for name, value in iteritems(self.cache)}
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]
638127
def _get_index(self):
        
        contour = self.contour
        value = contour.segments.index(self)
        return value
74966
def _get_index(self):
        
        contour = self.contour
        if contour is None:
            return None
        return contour.points.index(self)
335930
def route(method, path)
      method_routes = self.routes.find_all{|x| x.method == method}
      method_routes.each do |route|
        if route.path =~ WILDCARD_PATTERN
          src = "\\A#{route.path.gsub('*','(.*)')}\\Z"
          if match = path.match(Regexp.new(src))
            return [route, match[1].split('/')]
          end
        elsif route.path =~ NAMED_SEGMENTS_PATTERN
          src = "\\A#{route.path.gsub(NAMED_SEGMENTS_REPLACEMENT_PATTERN, '/(?<\1>[^$/]+)')}\\Z"
          if match = path.match(Regexp.new(src))
            return [route, Hash[match.names.zip(match.captures)]]
          end
        elsif path == route.path
          return [route]
        end
      end
      nil
    end
332427
function routeType(route) {
	var fields = Object.keys(RouteTypeFields);
	for (var i = 0, len = fields.length; i < len; i++) {
		var field = fields[i];
		if (route[field]) {
			return RouteTypeFields[field];
		}
	}
	return 'unknown';
}
463747
def _find_node_by_indices(self, point):
        "
        path_index, node_index = point
        path = self.paths[int(path_index)]
        node = path.nodes[int(node_index)]
        return node