FOR ROUTE MATCHING
420900
public function validatesTheseParameters(array $indexed_request_parameters) :bool {
		// for each of the parameters to validate
		foreach($indexed_request_parameters as $index => $value) {
			// if it fails to validate
			if(!$this->validateThisParameter($index, $value)) {
				return false;
			}
		}
		// if we got there, they all passed
		return true;
	}
1264653
function areScenesShallowEqual(one, two) {
  return (
    one.key === two.key &&
    one.index === two.index &&
    one.isStale === two.isStale &&
    one.isActive === two.isActive &&
    areRoutesShallowEqual(one.route, two.route)
  );
}
140535
public function getMatchedRouteName()
    {
        if ($this->isFailure()) {
            return false;
        }
        if (! $this->matchedRouteName && $this->route) {
            $this->matchedRouteName = $this->route->getName();
        }

        return $this->matchedRouteName;
    }
282509
private function matchExact(): bool
    {
        foreach ($this->routesExact as $route) {
            if ($this->uri === $route['u']) { // compare the current URI array to this route URI array
                $this->control = $route['c']; // set control or this exact match

                return true; // exact match found
            }
        }

        return false; // exact match not found
    }
119188
private function _getRouteMatch($path,$routes)
	{
		foreach ($routes as $route)
		{
			if ($match = $route->getMatch($path, $this->metadata($route->getName())))
				return $match;
		}
		return false;
	}
1240825
def _add_up_route(self, results, real_time=True, stop_at_bounds=False):
        """"""

        start_bounds = self.start_coords['bounds']
        end_bounds = self.end_coords['bounds']

        def between(target, min, max):
            return target > min and target < max

        time = 0
        distance = 0
        for segment in results:
            if stop_at_bounds and segment.get('path'):
                x = segment['path']['x']
                y = segment['path']['y']
                if (
                    between(x, start_bounds.get('left', 0), start_bounds.get('right', 0)) or
                    between(x, end_bounds.get('left', 0), end_bounds.get('right', 0))
                ) and (
                    between(y, start_bounds.get('bottom', 0), start_bounds.get('top', 0)) or
                    between(y, end_bounds.get('bottom', 0), end_bounds.get('top', 0))
                ):
                    continue
            time += segment['crossTime' if real_time else 'crossTimeWithoutRealTime']
            distance += segment['length']
        route_time = time / 60.0
        route_distance = distance / 1000.0
        return route_time, route_distance
1316219
def find_matching_endpoints(self, swagger_ns):
        
        def match_func(operation, ns, rule):
            # only expose endpoints that have the correct path prefix and operation
            return (
                rule.rule.startswith(self.graph.build_route_path(swagger_ns.path, swagger_ns.prefix)) and
                operation in self.matching_operations
            )

        return list(iter_endpoints(self.graph, match_func))
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
722773
def map ref,route, options={}
      context = Context.collection[get_context]
      context.routes[ref]= Route.new(route, context,options)
    end
111043
function (route, data) {
            var count = 0,
                i = 0,
                defaults = {};
            // look at default values, if they match ...
            for (var name in route.defaults) {
                if (route.defaults[name] === data[name]) {
                    // mark as matched
                    defaults[name] = 1;
                    count++;
                }
            }
            for (; i < route.names.length; i++) {
                if (!data.hasOwnProperty(route.names[i])) {
                    return -1;
                }
                if (!defaults[route.names[i]]) {
                    count++;
                }

            }

            return count;
        }
811819
public Map<Route, Double> matchRoutes(String url) {
        Map<Route, Double> routeMap = new HashMap<>();

        if (hashRoute.containsKey(url)) {
            hashRoute.get(url).forEach(hashR -> routeMap.put(new Route(hashR, null), 1.5));
        }

        for (RegexRoute route : regexRoute) {
            Matcher matcher = route.getPattern().matcher(url);
            if (matcher.matches()) {
                routeMap.put(new Route(route, matcher), 1.0);
            }
        }
        return routeMap;
    }
1073624
def match_route_type_get
      hash = {}
      hash[:external] = false
      hash[:inter_area] = false
      hash[:internal] = false
      hash[:intra_area] = false
      hash[:level_1] = false
      hash[:level_2] = false
      hash[:local] = false
      hash[:nssa_external] = false
      hash[:type_1] = false
      hash[:type_2] = false
      str = config_get('route_map', 'match_route_type', @get_args)
      return hash if str.nil?
      str = str[0] if str.length == 1
      hash[:external] = true if str.include?('external')
      hash[:inter_area] = true if str.include?('inter-area')
      hash[:internal] = true if str.include?('internal')
      hash[:intra_area] = true if str.include?('intra-area')
      hash[:level_1] = true if str.include?('level-1')
      hash[:level_2] = true if str.include?('level-2')
      hash[:local] = true if str.include?('local')
      hash[:nssa_external] = true if str.include?('nssa-external')
      hash[:type_1] = true if str.include?('type-1')
      hash[:type_2] = true if str.include?('type-2')
      hash
    end
173594
function router(req, resp, next) {
    const routerPath = req.routePath || '';

    const beforeRunMiddleware = (route) => {
      const match = matchRoute(routerPath, req, route);
      if (!match) return false;

      const { params, path: matchPath } = match;

      if (options.params) req.params = { ...options.params, ...params };
      else req.params = params;

      // dynamically set req.routePath for the route
      req.routePath = routerPath + matchPath;
      return true;
    };
    const routeStack = compose(router.routes, { beforeRunMiddleware });

    return routeStack.call(this, req, resp, () => {
      req.routePath = routerPath;// restore routePath
      return next && next();
    });
  }
192108
function matchPath(a, b) {
        var regex = new RegExp('^' + a.join('~~'), 'i');
        return regex.test(b.join('~~'));
    }
149959
function findRoutes (dir, fileExtensions) {
  let files = fs.readdirSync(dir)
  let resolve = f => path.join(dir, f)
  let routes = files.filter(f => fileExtensions.indexOf(path.extname(f)) !== -1).map(resolve)
  let dirs = files.filter(f => fs.statSync(path.join(dir, f)).isDirectory()).map(resolve)
  return routes.concat(...dirs.map(subdir => findRoutes(subdir, fileExtensions)))
}
86255
function matchRoute(route, path) {

  if (route.pattern === undefined && route.path !== undefined) {
    var routePattern;

    if (route.path instanceof RegExp) {
      routePattern = route.path;
    } else {
      var routePath = normalize(route.path);
      routePattern = route.children.length > 0 ? routePath + '*' : routePath;
    }

    Object.defineProperty(route, 'pattern', {
      enumerable: false,
      value: pattern.newPattern(routePattern)
    });
  }

  if (route.pattern) {
    var match = route.pattern.match(path);

    if (match) {
      if (route.pattern.isRegex) {
        match = {_: match};
      }

      if (!match._ || match._[0] === '/' || match._[0] === '') {
        delete match._;
      }
    }

    return match;

  } else {
    return path === '/' || path === '' ? {} : {_: [path]};
  }
}
1217483
def match_patterns(pathname, patterns):
    """"""
    for pattern in patterns:
        if fnmatch(pathname, pattern):
            return True
    return False