returns an object with the properties: routeIndex - the route divergence index (the index of currentRoute at which the paths diverge) pathIndex - the index of the currentPath at which the paths diverge or undefined - if the paths are the same
545780
function getDivergenceIndexes(currentPath, newPath, routes) {
        // find where path differs
        var divergenceIndex // the index at which the paths diverge
        for(var n=0; n<currentPath.length; n++) {
            if(currentPath[n] !== newPath[n]) {
                divergenceIndex = n
                break;
            }
        }
        if(divergenceIndex === undefined && newPath.length > currentPath.length) {
            divergenceIndex = currentPath.length
        }

        if(divergenceIndex === undefined)
            return undefined

        return routeAndCorrectedPathIndexes(routes, divergenceIndex)
    }
992503
function findPathIndexInArray(array, path) {
  for(var i = 0; i < array.length; i++) {
    if(array[i].path === path) {
      return i;
    }
  }

  return -1;
}
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
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);
            }
        }
    }
950710
function (indexMap, loadOrder) {
                // In older versions indexMap was an object instead of a sparse array
                if (!('length' in indexMap)) {
                    var indexArray = [],
                        index;
                    
                    for (index in indexMap) {
                        if (!isNaN(+index)) {
                            indexArray[+index] = indexMap[index];
                        }
                    }
                    
                    indexMap = indexArray;
                }
                
                return Request.prototype.getPathsFromIndexes(indexMap, loadOrder);
            }
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';
}
482818
function(index) {

            var segments = this.segments;
            var numSegments = segments.length;
            if (numSegments === 0) throw new Error('Path has no segments.');

            if (index < 0) index = numSegments + index; // convert negative indices to positive
            if (index >= numSegments || index < 0) throw new Error('Index out of range.');

            return segments[index];
        }
354308
def get(self, path=None, method='GET', **options):
        
        return self.route(path, method, **options)
1279768
function getRouteParams(route, params) {
  var routeParams = {};

  if (!route.path) return routeParams;

  (0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {
    if (Object.prototype.hasOwnProperty.call(params, p)) {
      routeParams[p] = params[p];
    }
  });

  return routeParams;
}
49171
def get_current_path(index=2):  # type: (int) -> str
    
    try:
        path = _caller_path(index)
    except RuntimeError:
        path = os.getcwd()
    return path
1195133
def get(self, route: str(), callback: object()):
        
        self.__set_route('get', {route: callback})
        return RouteMapping
1223193
function (route) {
  if (!route) {
    return null;
  }
  let ts = route.split('.');
  if (ts.length !== 3) {
    return null;
  }

  return {
    route: route,
    serverType: ts[0],
    handler: ts[1],
    method: ts[2]
  };
}
1047978
int createPathUserIndex() {
		if (m_pathindices == null)
			m_pathindices = new ArrayList<AttributeStreamOfInt32>(0);
		// Try getting existing index. Use linear search. We do not expect many
		// indices to be created.
		for (int i = 0; i < m_pathindices.size(); i++) {
			if (m_pathindices.get(i) == null) {
				m_pathindices.set(i,
						(AttributeStreamOfInt32) (AttributeStreamBase
								.createIndexStream(0)));
				return i;
			}
		}

		m_pathindices.add((AttributeStreamOfInt32) (AttributeStreamBase
				.createIndexStream(0)));
		return (int) (m_pathindices.size() - 1);
	}
866154
@Pure
	public int lastIndexOf(RoadSegment segment) {
		int count = 0;
		int index;
		int lastIndex = -1;
		for (final RoadPath p : this.paths) {
			index = p.lastIndexOf(segment);
			if (index >= 0) {
				lastIndex = count + index;
			}
			count += p.size();
		}
		return lastIndex;
	}
342613
function(path) {
    var index = this;
    if (path !== null) {
      for (var i = 0; i < path.length; i++) {
        var id = path[i];
        index.scopes[id] = index.scopes[id] || { nodes: {}, scopes: {} };
        index = index.scopes[id];
      }
    }
    return index;
  }
1085919
def get_route(self, name):
        '''
        '''
        for route in self.routes:
            if route.name == name:
                return route
        for child in self.routes:
            route = child.get_route(name)
            if route:
                return route
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;
}