Returns route descriptor
514615
function get(params){
    var path = params.path;
    var config = params.config;

    if (path instanceof Route)
      return path;

    var route;
    // If there is no config specified - it should be a plain route, so we try to reuse it
    if (!config)
      route = plainRoutesByPath[path];

    if (!route && params.autocreate)
    {
      var parseInfo = Object.prototype.toString.call(path) == '[object RegExp]'
        ? { path: path, regexp: path, ast: null, params: [] }
        : parsePath(path);
      route = createRoute(parseInfo, config);
      allRoutes.push(route);

      if (route instanceof ParametrizedRoute == false)
        plainRoutesByPath[path] = route;

      if (typeof currentPath == 'string')
      {
        var flags = route.processLocation_(currentPath);

        if (flags & ROUTE_ENTER)
          routeEnter(route);
        if (flags & ROUTE_MATCH)
          routeMatch(route);
      }
    }

    return route;
  }
1261424
function getRoutes(feature) {
  const targetPath = `src/features/${feature}/route.js`; //utils.mapFeatureFile(feature, 'route.js');
  if (vio.fileNotExists(targetPath)) return [];
  const theAst = ast.getAst(targetPath);
  const arr = [];
  let rootPath = '';
  let indexRoute = null;

  traverse(theAst, {
    ObjectExpression(path) {
      const node = path.node;
      const props = node.properties;
      if (!props.length) return;
      const obj = {};
      props.forEach(p => {
        if (_.has(p, 'key.name') && !p.computed) {
          obj[p.key.name] = p;
        }
      });
      if (obj.path && obj.component) {
        // in a route config, if an object expression has both 'path' and 'component' property, then it's a route config
        arr.push({
          path: _.get(obj.path, 'value.value'), // only string literal supported
          component: _.get(obj.component, 'value.name'), // only identifier supported
          isIndex: !!obj.isIndex && _.get(obj.isIndex, 'value.value'), // suppose to be boolean
          node: {
            start: node.start,
            end: node.end,
          },
        });
      }
      if (obj.isIndex && obj.component && !indexRoute) {
        // only find the first index route
        indexRoute = {
          component: _.get(obj.component, 'value.name'),
        };
      }
      if (obj.path && obj.childRoutes && !rootPath) {
        rootPath = _.get(obj.path, 'value.value');
        if (!rootPath) rootPath = '$none'; // only find the first rootPath
      }
    },
  });
  const prjRootPath = getRootRoutePath();
  if (rootPath === '$none') rootPath = prjRootPath;
  else if (!/^\//.test(rootPath)) rootPath = prjRootPath + '/' + rootPath;
  rootPath = rootPath.replace(/\/+/, '/');
  arr.forEach(item => {
    if (!/^\//.test(item.path)) {
      item.path = (rootPath + '/' + item.path).replace(/\/+/, '/');
    }
  });
  if (indexRoute) {
    indexRoute.path = rootPath;
    arr.unshift(indexRoute);
  }
  return arr;
}
1156572
def access_route(self):
        
        if "HTTP_X_FORWARDED_FOR" in self.environ:
            addr = self.environ["HTTP_X_FORWARDED_FOR"].split(",")
            return self.list_storage_class([x.strip() for x in addr])
        elif "REMOTE_ADDR" in self.environ:
            return self.list_storage_class([self.environ["REMOTE_ADDR"]])
        return self.list_storage_class()
716677
def get_routing_tuples(cls):
        ''''''
        for callback in cls.callbacks:
            ep_name = '{}.{}'.format(cls.api.__name__, callback.__name__)
            yield (Rule(cls.endpoint_path,
                        endpoint=ep_name,
                        methods=callback.swagger_ops),
                   callback)
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
1352001
function getRoute(params) {
    params.route = params.route || "";
    var localeRoute = utils.getLocaleRoute(),
        pageRoute = localeRoute + "/:page/",
        settingsRoute = utils.getAppSettingsRoute() + "/";

    return (params.isAppRoute ? AppURL + "/" : params.settings ? settingsRoute : pageRoute)
        + params.pluginId + (params.many ? "/:iId" : "") + params.route
}
532984
function routePath (route) {
  if (!route) return ''
  return route.path || (route.regexp && route.regexp.source) || ''
}
132732
def get_routertypes(self, context, filters=None, fields=None,
                        sorts=None, limit=None, marker=None,
                        page_reverse=False):
        """"""
        pass
208470
def _parse_routes():
    '''
    
    '''
    with salt.utils.files.fopen('/proc/net/route', 'r') as fp_:
        out = salt.utils.stringutils.to_unicode(fp_.read())

    ret = {}
    for line in out.splitlines():
        tmp = {}
        if not line.strip():
            continue
        if line.startswith('Iface'):
            continue
        comps = line.split()
        tmp['iface'] = comps[0]
        tmp['destination'] = _hex_to_octets(comps[1])
        tmp['gateway'] = _hex_to_octets(comps[2])
        tmp['flags'] = _route_flags(int(comps[3]))
        tmp['refcnt'] = comps[4]
        tmp['use'] = comps[5]
        tmp['metric'] = comps[6]
        tmp['mask'] = _hex_to_octets(comps[7])
        tmp['mtu'] = comps[8]
        tmp['window'] = comps[9]
        tmp['irtt'] = comps[10]
        if comps[0] not in ret:
            ret[comps[0]] = []
        ret[comps[0]].append(tmp)
    return ret
223712
def _generate_routes_m(self, namespace):
        """"""
        with self.block_m(
                fmt_routes_class(namespace.name, self.args.auth_type)):
            init_args = fmt_func_args_declaration([(
                'client', 'id<{}>'.format(self.args.transport_client_name))])

            with self.block_func(
                    func='init', args=init_args, return_type='instancetype'):
                self.emit('self = [super init];')
                with self.block_init():
                    self.emit('_client = client;')
            self.emit()
            style_to_request = json.loads(self.args.z__style_to_request)

            for route in namespace.routes:
                if (route.attrs.get('auth') != self.args.auth_type
                        and route.attrs.get('auth') != 'noauth'):
                    continue

                route_type = route.attrs.get('style')
                client_args = json.loads(self.args.client_args)

                if route_type in client_args.keys():
                    for args_data in client_args[route_type]:
                        task_type_key, type_data_dict = tuple(args_data)
                        task_type_name = style_to_request[task_type_key]

                        func_suffix = type_data_dict[0]
                        extra_args = [
                            tuple(type_data[:-1])
                            for type_data in type_data_dict[1]
                        ]

                        if (is_struct_type(route.arg_data_type) and
                                self._struct_has_defaults(route.arg_data_type)):
                            route_args, _ = self._get_default_route_args(
                                namespace, route)
                            self._generate_route_m(route, namespace,
                                                   route_args, extra_args,
                                                   task_type_name, func_suffix)

                        route_args, _ = self._get_route_args(namespace, route)
                        self._generate_route_m(route, namespace, route_args,
                                               extra_args, task_type_name,
                                               func_suffix)
                else:
                    task_type_name = style_to_request[route_type]
                    if (is_struct_type(route.arg_data_type) and
                            self._struct_has_defaults(route.arg_data_type)):
                        route_args, _ = self._get_default_route_args(
                            namespace, route)
                        self._generate_route_m(route, namespace, route_args,
                                               [], task_type_name, '')

                    route_args, _ = self._get_route_args(namespace, route)
                    self._generate_route_m(route, namespace, route_args, [],
                                           task_type_name, '')
1071400
def get_route(self, npaths=1, time_delta=0):
        """"""

        routing_server = self.ROUTING_SERVERS[self.region]

        url_options = {
            "from": "x:%s y:%s" % (self.start_coords["lon"], self.start_coords["lat"]),
            "to": "x:%s y:%s" % (self.end_coords["lon"], self.end_coords["lat"]),
            "at": time_delta,
            "returnJSON": "true",
            "returnGeometries": "true",
            "returnInstructions": "true",
            "timeout": 60000,
            "nPaths": npaths,
            "options": "AVOID_TRAILS:t",
        }
        if self.vehicle_type:
            url_options["vehicleType"] = self.vehicle_type

        response = requests.get(self.WAZE_URL + routing_server, params=url_options, headers=self.HEADERS)
        response.encoding = 'utf-8'
        response_json = self._check_response(response)
        if response_json:
            if 'error' in response_json:
                raise WRCError(response_json.get("error"))
            else:
                if response_json.get("alternatives"):
                    return [alt['response'] for alt in response_json['alternatives']]
                if npaths > 1:
                    return [response_json['response']]
                return response_json['response']
        else:
            raise WRCError("empty response")
1148254
def get_route_io_data_types_for_route(self, route):
        # type: (ApiRoute) -> typing.Set[UserDefined]
        
        data_types = set()  # type: typing.Set[UserDefined]
        for dtype in (route.arg_data_type, route.result_data_type, route.error_data_type):
            while is_list_type(dtype) or is_nullable_type(dtype):
                data_list_type = dtype  # type: typing.Any
                dtype = data_list_type.data_type
            if is_composite_type(dtype) or is_alias(dtype):
                data_user_type = dtype  # type: typing.Any
                data_types.add(data_user_type)
        return data_types
172932
public static String getControllerForResult(Route route) {
        if (route == null || route.getController() == null) return Constants.ROOT_CONTROLLER_NAME;
        return RouterHelper.getReverseRouteFast(route.getController()).substring(1);
    }
1165826
protected RoutesDefinition getRoutesDefinition(String name, String version) throws AdapterException {
        String modifier = "";
        Map<String,String> params = getHandlerParameters();
        if (params != null) {
            for (String paramName : params.keySet()) {
                if (modifier.length() == 0)
                    modifier += "?";
                else
                    modifier += "&amp;";

                modifier += paramName + "=" + params.get(paramName);
            }
        }

        Map<String,String> customAttrs = null;
        String customAttrString = getAttributeValue(CUSTOM_ATTRIBUTES);
        if (!StringHelper.isEmpty(customAttrString)) {
            customAttrs = StringHelper.parseMap(customAttrString);
        }

        RoutesDefinitionRuleSet rdrs;
        if (version == null)
            rdrs = CamelRouteCache.getRoutesDefinitionRuleSet(name, modifier, customAttrs);
        else
            rdrs = CamelRouteCache.getRoutesDefinitionRuleSet(new AssetVersionSpec(name, version), modifier, customAttrs);

        if (rdrs == null) {
            throw new AdapterException("Unable to load Camel route: " + name + modifier);
        }
        else {
            super.logdebug("Using RoutesDefinition: " + rdrs.getRuleSet().getLabel());
            return rdrs.getRoutesDefinition();
        }
    }
521864
def to_dict(self):
        

        rv = {
            'id': self.id,
            'type': self.type,
            'priority': self.priority
        }
        if self.recip_keys:
            rv['routingKeys'] = [canon_ref(k.did, k.id, '#') for k in  self.recip_keys]
        if self.routing_keys:
            rv['routingKeys'] = [canon_ref(k.did, k.id, '#') for k in self.routing_keys]
        rv['serviceEndpoint'] = self.endpoint

        return rv
875383
function describeRoute(route) {
		var host = route.Host;
		var domain = route.DomainName;
		var apps = route.Apps;
		var appsNum = route.Apps.length;

		var strResult = "\n" + host + "\t" + domain;

		if(appsNum != 0){
			strResult += "\t" + route.Apps[0].Name;
			if(appsNum > 1){
				for(var i = 1; i < appsNum; i++){
					strResult += ", " + route.Apps[i].Name;
				}
			}
		}
		return strResult;
	}
638737
function getInstanceRoute(machineName, versionKey, instanceKey){

        let manifest = getManifest();

        let machine = manifest.machines[machineName];
        if (!machine) {
            throw new Error("Machine does not exists");
        }

        let version = machine.versions[versionKey];
        if (!version) {
            throw new Error("Version does not exists");
        }

        let instance = version.instances[instanceKey];
        if (!instance) {
            throw new Error("Instance does not exists");
        }

        return instance.route;
    }