Extracts the route from the accessed URL and sets it to __end_point_uri
        :rtype: bool
185685
def set_end_point_uri(self) -> bool:
        
        expected_parts = self.__route.split("/")
        actual_parts = self.__uri.split("/")

        i = 0
        for part in expected_parts:
            if part != actual_parts[i]:
                return False
            i = i + 1

        uri_prefix = len(self.__route)
        self.__end_point_uri = self.__uri[uri_prefix:]
        return True
764919
def get_endpoint(self):
        
        if self.endpoint:
            return self.endpoint
        else:
            return self.service_context.provider_info[self.endpoint_name]
491135
def exec_route_callback(self) -> Response or object:
        
        if self.__method.lower() in self.__end_points:
            for bound in self.__end_points[self.__method.lower()]:

                route = list(bound)[0]
                expected_params = self.get_url_params(route)
                actual_params = self.get_url_params(self.get_end_point_uri())

                if self.request_matches_route(self.get_end_point_uri(), route):
                    self.app.log.info("> {0} {1}".format(self.__method, self.__uri))
                    if self.authenticate(route, actual_params):
                        self.app.log.debug(
                            "%s(%d) %s" % ("body ", len(self.__request.body), self.__request.body.decode('utf-8'))
                        )
                        pattern_params = self.get_callback_pattern(expected_params, actual_params)
                        self.app.request_handle_time = (
                            lambda d: int((d.days * 24 * 60 * 60 * 1000) + (d.seconds * 1000) + (d.microseconds / 1000))
                        )(datetime.now() - self.__request_start)

                        return bound[route](self.__request, self.app, **pattern_params)
                    else:
                        raise AuthException("Authentication failed.")

        if self.__method == "OPTIONS":
            self.app.log.info("Route matched: {0} {1}".format(self.__method, self.__uri))
            return self.default_route_options()

        if self.__route == '' and self.__uri == '':
            return self.welcome_page()
        else:
            return self.no_route_found(self.__request)
805677
def get_routes(iface):
    '''
    
    '''

    filename = os.path.join(_DEB_NETWORK_UP_DIR, 'route-{0}'.format(iface))
    results = _read_file(filename)

    filename = os.path.join(_DEB_NETWORK_DOWN_DIR, 'route-{0}'.format(iface))
    results += _read_file(filename)

    return results
729740
def endpoint(url):
    """"""
    if not url:
        click.secho(dtool_config.utils.get_ecs_endpoint(CONFIG_PATH))
    else:
        click.secho(dtool_config.utils.set_ecs_endpoint(CONFIG_PATH, url))
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)
551304
def get_url endpoint, method
      api = @wp_api ? 'wp-json' : 'wc-api'
      url = @url
      url = "#{url}/" unless url.end_with? "/"
      url = "#{url}#{api}/#{@version}/#{endpoint}"

      @is_ssl ? url : oauth_url(url, method)
    end
1273996
def _route(self):
        '''  '''
        self._app.route('/',
                        method='GET',
                        callback=self._get_logger_list)
        self._app.route('/stats',
                        method='GET',
                        callback=self._fetch_handler_stats)
        self._app.route('/<name>/start',
                        method='POST',
                        callback=self._add_logger_by_name)
        self._app.route('/<name>/stop',
                        method='DELETE',
                        callback=self._stop_logger_by_name)
        self._app.route('/<name>/config',
                        method='GET',
                        callback=self._get_logger_conf)
        self._app.route('/<name>/rotate',
                        method='POST',
                        callback=self._rotate_capturer_log)
615159
def _url(endpoint: str, sandbox: bool=False) -> str:
    """"""
    if sandbox is True:
        url = BASE_URL_SANDBOX
    else:
        url = BASE_URL
    return "{0}{1}".format(url, endpoint)
325037
def url_for(context, __route_name, **parts):
    
    app = context['app']

    query = None
    if 'query_' in parts:
        query = parts.pop('query_')

    for key in parts:
        val = parts[key]
        if isinstance(val, str):
            # if type is inherited from str expilict cast to str makes sense
            # if type is exactly str the operation is very fast
            val = str(val)
        elif type(val) is int:
            # int inherited classes like bool are forbidden
            val = str(val)
        else:
            raise TypeError("argument value should be str or int, "
                            "got {} -> [{}] {!r}".format(key, type(val), val))
        parts[key] = val

    url = app.router[__route_name].url_for(**parts)
    if query:
        url = url.with_query(query)
    return url
29955
def fromOPEndpointURL(cls, op_endpoint_url):
        
        service = cls()
        service.server_url = op_endpoint_url
        service.type_uris = [OPENID_IDP_2_0_TYPE]
        return service
1263285
def url_for(endpoint, **kw):
    

    _endpoint = None
    if isinstance(endpoint, six.string_types):
        return f_url_for(endpoint, **kw)
    else:
        # self, will refer the caller method, by getting the method name
        if isinstance(endpoint, Mocha):
            fn = sys._getframe().f_back.f_code.co_name
            endpoint = getattr(endpoint, fn)

        if is_method(endpoint):
            _endpoint = _get_action_endpoint(endpoint)
            if not _endpoint:
                _endpoint = _build_endpoint_route_name(endpoint)
    if _endpoint:
        return f_url_for(_endpoint, **kw)
    else:
        raise exceptions.MochaError('Mocha `url_for` received an invalid endpoint')
354308
def get(self, path=None, method='GET', **options):
        
        return self.route(path, method, **options)
852415
def base_path(self):
        
        path = UrlPath()

        # Walk up the API to find the base object
        parent = self.parent
        while parent:
            path_prefix = getattr(parent, 'path_prefix', NoPath)
            path = path_prefix + path
            parent = getattr(parent, 'parent', None)

        return path
1333513
def _read_routes_c_v1():
    """"""
    def _extract_ip(obj):
        return inet_ntop(socket.AF_INET, struct.pack("<I", obj))
    routes = []
    for route in GetIpForwardTable():
        ifIndex = route['ForwardIfIndex']
        dest = route['ForwardDest']
        netmask = route['ForwardMask']
        nexthop = _extract_ip(route['ForwardNextHop'])
        metric = route['ForwardMetric1']
        # Build route
        try:
            iface = dev_from_index(ifIndex)
            if iface.ip == "0.0.0.0":
                continue
        except ValueError:
            continue
        ip = iface.ip
        # RouteMetric + InterfaceMetric
        metric = metric + iface.ipv4_metric
        routes.append((dest, netmask, nexthop, iface, ip, metric))
    return routes
1298922
def get_endpoint_server_root(self):
        
        parsed = urlparse(self._endpoint)
        root = parsed.scheme + "://" + parsed.hostname

        if parsed.port is not None:
            root += ":" + unicode(parsed.port)

        return root
1195133
def get(self, route: str(), callback: object()):
        
        self.__set_route('get', {route: callback})
        return RouteMapping