/*
It is the main entry point to check using route name and return boolean
437635
public function checkQueryBoolean($fullUrlWithQuery)
    {
        if (is_array($fullUrlWithQuery)) {
            $result = call_user_func_array(array($this,'queryIsDeeply'), $fullUrlWithQuery);
        } else {
            $result = $this->queryIsDeeply($fullUrlWithQuery);   
        }
        return $result;
    }
353081
def check_map(uri, url_root):
    
    # TODO: Building the Map each time this is called seems like it could be more effiecent.
    result = []
    try:
        result = db.execute(text(fetch_query_string('select_route_where_dynamic.sql'))).fetchall()
    except OperationalError as err:
        current_app.logger.error("OperationalError: %s", err)
        return (None, None)
    if result:
        #routes = result.as_dict()
        #(routes, col_names) = rowify(result, c.description)
        #current_app.logger.debug( [x['rule'] for x in routes] )
        rules = map( lambda r: Rule(r['rule'], endpoint='dynamic'), result )
        d_map = Map( rules )
        map_adapter = d_map.bind(url_root)
        #current_app.logger.debug(uri)
        try:
            (rule, rule_kw) = map_adapter.match(path_info=uri, return_rule=True)
            #current_app.logger.debug(rule)
            return (str(rule), rule_kw)
        except HTTPException:
            pass
    return (None, {})
1023258
protected function isValidRoute()
    {
        try {

            $current = Route::current();
            if (!$current) {
                return false;
            }
            $action = $current->action;
            $as     = array_get($action, 'as');
            return str_contains($as, 'show') or str_contains($as, 'dashboard');
        } catch (Exception $ex) {
            return false;
        }
    }
652898
function () {
        var rootURL = this._getRootURL();
        var path = this._getPath();
        var hash = this._getHash();
        var query = this._getQuery();
        var rootURLIndex = path.indexOf(rootURL);
        var routeHash, hashParts;

        Ember.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0);

        // By convention, Ember.js routes using HashLocation are required to start
        // with `#/`. Anything else should NOT be considered a route and should
        // be passed straight through, without transformation.
        if (hash.substr(0, 2) === '#/') {
          // There could be extra hash segments after the route
          hashParts = hash.substr(1).split('#');
          // The first one is always the route url
          routeHash = hashParts.shift();

          // If the path already has a trailing slash, remove the one
          // from the hashed route so we don't double up.
          if (path.slice(-1) === '/') {
              routeHash = routeHash.substr(1);
          }

          // This is the "expected" final order
          path += routeHash;
          path += query;

          if (hashParts.length) {
            path += '#' + hashParts.join('#');
          }
        } else {
          path += query;
          path += hash;
        }

        return path;
      }
124894
function findRouteName(routeToTest) {
    if (!window.Backbone) {
        throw new Error('Dependency: Backbone is missing.');
    }
    let handlers = window.Backbone.history.handlers;
    //console.log('handlers', )
    let h = find(handlers, function (handler) {
        return handler.route.test(routeToTest);
    });
    if (h !== undefined) {
        return h.route.toString();
    }
    return some(handlers, function (handler) {
        if (handler.route.test(routeToTest)) {
            return handler.route.toString();
        }
    });
}
1192745
function(routeName, models, queryParams) {
        var router = this.router;
        return router.isActive.apply(router, arguments);
      }
361682
private function specificRouteRestrictionExists()
    {
        $requestMethod = isset($_POST['_method']) ? $_POST['_method'] : $_SERVER['REQUEST_METHOD'];
        
        $routes = app('router')->getRoutes()->match(app('request')->create($_SERVER['REQUEST_URI'], $requestMethod));


        if (!$routes) {
            throw new Exception('Error determining current route.');
        }

        if (get_class($routes) != \Illuminate\Routing\Route::class && count($routes) != 1) {
            $routes = $routes->first();
        }
        
        foreach($routes->middleware() as $routeMiddleware) {
            $routeMiddlewareParts = explode(':', $routeMiddleware);
            if ($routeMiddlewareParts[0]=='routeRestrictor') {
                return true;
            }
        }

        return false;
    }
1085804
protected function matchDirect()
    {
        // Create variable used to keep track on progress
        $endpoint = false;

        // check without a trailing slash
        if (isset($this->routes[$this->requestUri])) {
            $endpoint = $this->routes[$this->requestUri];
        } else {
            // no match return false
            return false;
        }

        // check if endpoint class exists
        if (!$this->endpointExists($endpoint)) {
            throw new NotFound();
        } elseif (!$this->endpointMethodExists($endpoint, $this->requestMethod)) {
            // route found but method can't be found
            throw new MethodNotAllowed();
        }

        // found a direct match, set needed properties
        $this->matchedRoute = $this->requestUri;
        $this->matchedEndpoint = $endpoint;
        $this->matchedMethod = $this->requestMethod;

        // we found our match, stop looking for more
        return true;
    }
533801
async function _default(config, routesConfig) {
  const res = await (0, _startApp.default)(config);
  const {
    url,
    app,
    router,
    middleware,
    connect
  } = res;
  let methods;

  if (routesConfig) {
    methods = await (0, _routes.initRoutes2)(routesConfig, middleware, router);
    const routes = router.routes();
    app.use(routes);
  }

  return {
    url,
    app,
    connect,
    methods,
    router
  };
}
45552
def get_working_if():
    """"""
    try:
        # return the interface associated with the route with smallest
        # mask (route by default if it exists)
        iface = min(conf.route.routes, key=lambda x: x[1])[3]
    except ValueError:
        # no route
        iface = scapy.consts.LOOPBACK_INTERFACE
    if iface.is_invalid():
        # Backup mode: try them all
        for iface in six.itervalues(IFACES):
            if not iface.is_invalid():
                return iface
        return None
    return iface
1293542
function getMiddlewareNames(route) {
		var middleware = getRouteMiddleware(route);

		// If the middleware is an array, just return it
		if ( middleware instanceof Array ) {
			return middleware;
		}

		// If there is no middleware, then return an empty array
		if ( typeof middleware === 'undefined' ) {
			return [];
		}

		// Otherwise, split the pipes & return an array
		return middleware.split('|');
	}
288521
function getDefaultRoute() {
  try {
    const fileContents = fs.readFileSync('/proc/net/route', 'utf8'); // eslint-disable-line no-sync
    const routes = fileContents.split('\n');
    for (const routeIdx in routes) {
      const fields = routes[routeIdx].trim().split('\t');
      if (fields[1] === '00000000') {
        const address = fields[2];
        // Convert to little endian by splitting every 2 digits and reversing that list
        const littleEndianAddress = address.match(/.{2}/g).reverse().join('');
        return intToIP(parseInt(littleEndianAddress, 16));
      }
    }
  } catch (e) {
    console.error('Could not get default route from /proc/net/route');
  }
  return null;
}
1238895
function(route, name, callback) 
	{
		var regExp = conbo.isRegExp(route) ? route : this.__routeToRegExp(route);
		
		if (!callback) 
		{
			callback = this[name];
		}
		
		if (conbo.isFunction(name)) 
		{
			callback = name;
			name = '';
		}
		
		if (!callback) 
		{
			callback = this[name];
		}
		
		this.__history.addRoute(regExp, (function(path)
		{
			var args = this.__extractParameters(regExp, path);
			
			var params = conbo.isString(route) 
				? conbo.object((route.match(/:\w+/g) || []).map(function(r) { return r.substr(1); }), args) 
				: {}
				;
			
			callback && callback.apply(this, args);
			
			var options = 
			{
				router:		this,
				route:		regExp,
				name:		name,
				parameters:	args,
				params:		params,
				path:		path
			};
			
			this.dispatchEvent(new conbo.ConboEvent('route:'+name, options));
			this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.ROUTE, options));
			
		}).bind(this));
		
		return this;
	}
738917
function () {

            if (this.$processUrl) {
                var currentFragment = this._getFragment();
                if (currentFragment == this.$fragment) {
                    return false;
                }

                this.navigate(currentFragment, !this.$.useState, true, true, emptyCallback);
            }

            this.$processUrl = true;

        }
914165
function(route) {
  if (!route) {
    return null;
  }
  var idx = route.indexOf('.');
  if (idx < 0) {
    return null;
  }
  return route.substring(0, idx);
}
3551
protected function isMatchingRouteName()
    {
        return $this->getCurrentRouteName() == $this->getRouteName() || array_key_exists($this->getCurrentRouteName(), $this->getAliasRouteNames());
    }
860481
function RouteRule_parseRequest(method, url) {

        var matches,
            route,
            key,
            result = [],
            escape = [],
            params = {},
            current;
        //match pathname
        matches = this.match(this.pattern, this.trim(url.pathname, '/'));


        if (!matches.length || !this.checkMethod(method)) {
            return false;
        }
        params = url.query;


        for (key in params) {
            current = this.find(matches, key);
            if (!current || current.value === '') {
                matches.push({
                    key: key,
                    value: params[key]
                });
            }
        }

        matches.forEach(function (item) {
            var current = this.find(this.routeParams, item.key);
            if (current) {
                escape.push({
                    key: '<' + current.key + '>',
                    value: item.value
                });
                delete params[item.name];
            } else if (this.find(this.paramRules, item.key)) {
                params[item.key] = item.value;
            }
        }.bind(this));


        if (this.routeParams.length) {
            route = this.escape(this.route, escape);
        } else {
            route = this.route;
        }

        result.push(route);
        result.push(params);

        return result;
    }