Routing environment which routes by `location.pathname`.
336048
function PathnameEnvironment() {
  this.onPopState = this.onPopState.bind(this);
  this.useHistoryApi = !!(window.history &&
                          window.history.pushState &&
                          window.history.replaceState);
  Environment.call(this);
}
396107
function assembleRoutes( { places } ) {
      const routeMap = {};
      forEach( places, ( place, placeId ) => {
         place.id = placeId;
         place.patterns = place.patterns || [ `/${placeId}` ];
         setPath( place, `targets.${TARGET_SELF}`, place.id );

         const { id, patterns, page, redirectTo, redirectToPath } = place;
         availablePlaces[ id ] = place;

         if( redirectTo ) {
            patterns.forEach( pattern => {
               routeMap[ pattern ] = parameters => {
                  navigateToTarget( redirectTo, parameters, null, place );
               };
            } );
            return;
         }

         if( redirectToPath ) {
            patterns.forEach( pattern => {
               routeMap[ pattern ] = () => {
                  navigateToPath( redirectToPath, place );
               };
            } );
            return;
         }

         if( !page ) {
            log.error( `flow: invalid empty place: ${id}` );
            return;
         }

         patterns.forEach( pattern => {
            routeMap[ pattern ] = ( parameters, fragment ) => {
               handleRouteChange( place, parameters, fragment );
            };
         } );
      } );
      return routeMap;
   }
957536
function buildRouterPath(path, prefix) {
	if (!prefix) {
		prefix = '';
	}

	if (prefix.length && path === '/') {
		return prefix;
	}

	return prefix + path;
}
931081
def _get_path_by_name(part, paths):
    
    for path in paths:
        if path.alias == part:
            return path
    raise ValueError
1255551
def dispatch(environ, start_response, mapper):
    
    result = mapper.match(environ=environ)
    if result is None:
        info = environ.get('PATH_INFO', '')
        LOG.debug('The route for %s can not be found', info)
        raise webob.exc.HTTPNotFound(
            json_formatter=util.json_error_formatter)

    handler = result.pop('action')

    environ['wsgiorg.routing_args'] = ((), result)
    return handler(environ, start_response)
1372502
def route_for(name)
      name = name.to_s
      @routes.select { |entry| entry.name == name }.first
    end
442277
function _path(loc) {
	loc = loc || location;
	return loc.pathname + loc.search + loc.hash;
}
700347
function getRouteFiles (pathName) {
    var items = fs.readdirSync(pathName);
    var files = [];

    items.forEach(function(itemName) {
        var fullName = path.join(pathName, itemName);
        var fsStat = fs.statSync(fullName);

        // If directory, then scan for "routes.js"
        if (fsStat.isDirectory()) {
            getRouteFiles(fullName).forEach(function(a) {
                files.push(a);
            });
        } else if (fsStat.isFile() && itemName === 'routes.js') {
            // routes.js found, append to list
            files.push(fullName);
        }
    });

    return files;
}
203489
def _route p
            if p.room.nil? or p.room==path
                if door = @iotas[p.door]
                    p.dst_routed! door
                else
                    p.error! Edoors::ERROR_ROUTE_RRWD
                end
            elsif door = @spin.search_world(p.room+Edoors::PATH_SEP+p.door)
                p.dst_routed! door
            else
                p.error! Edoors::ERROR_ROUTE_DNE
            end
        end
678468
def _create_path(self, *args):
        """"""
        args = filter(None, args)
        path = self.endpoint + '/'.join(args)
        return path
756524
def p_route(self, p):
        """"""
        p[0] = AstRouteDef(self.path, p.lineno(1), p.lexpos(1), p[2], p[3], p[5], *p[4])
        if len(p) > 7:
            p[0].set_doc(p[8])
            if p[9]:
                keys = set()
                for attr in p[9]:
                    if attr.name in keys:
                        msg = "Attribute '%s' defined more than once." % attr.name
                        self.errors.append((msg, attr.lineno, attr.path))
                    keys.add(attr.name)
                p[0].set_attrs(p[9])
149713
def navigate(self, name, *args):
        
        if name not in self.routes:
            raise Exception('invalid route name \'%s\'' % name)
        elif callable(self.routes[name]):
            return self.routes[name](self, *args)
        raise Exception('route %s not callable', name)
1077029
def location_path(cls, project, location):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/locations/{location}",
            project=project,
            location=location,
        )
1193383
def path_for(self, *args):
        """"""
        if args and args[0].startswith(os.path.sep):
            return os.path.join(*args)
        return os.path.join(self._root_path or os.getcwd(), *args)
517973
def route(self):
        """"""
        dst = self.dst
        if isinstance(dst, Gen):
            dst = next(iter(dst))
        return conf.route6.route(dst)
602292
def routing(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('routing', **{
        'name': name,
        'locator': ctx.locator,
    })
1207419
def cnormpath (path):
    """"""
    path = normpath(path)
    if os.name == 'nt':
        # replace slashes with backslashes
        path = path.replace("/", "\\")
    if not os.path.isabs(path):
        path = normpath(os.path.join(sys.prefix, path))
    return path