Find callable for the specified URL path and HTTP method.

        Args:
            path (:obj:`str`): URL path to match
            method (:obj:`str`): HTTP method

        Note:
            A trailing '/' is always assumed in the path.
335874
def find_call(self, path, method):
        
        if not path.endswith('/'):
            path += '/'
        path = path.split('/')[1:]
        return self._recursive_route_match(self._routes, path, method, [])
339779
def match_url(self, request):
        
        matched = False
        if self.exact_url:
            if re.match("%s$" % (self.url,), request.path):
                matched = True
        elif re.match("%s" % self.url, request.path):
            matched = True
        return matched
293134
def find_matching_middleware(self, method, path):
        
        for mw in self.mw_list:
            if not mw.matches_method(method):
                continue

            # get the path matching this middleware and the 'rest' of the url
            # (i.e. the part that comes AFTER the match) to be potentially
            # matched later by a subchain
            path_match, rest_url = mw.path_split(path)
            if self.should_skip_middleware(mw, path_match, rest_url):
                continue

            yield mw, path_match, rest_url
522701
def catch_all(path):
    
    return (dict(error='Invalid URL: /{}'.format(path),
                 links=dict(root='{}{}'.format(request.url_root, PREFIX[1:]))),
            HTTPStatus.NOT_FOUND)
1059349
def validate_path_to_api_path(path, paths, basePath='', context=None, **kwargs):
    
    if context is None:
        context = {}
    try:
        api_path = match_path_to_api_path(
            path_definitions=paths,
            target_path=path,
            base_path=basePath,
            context=context,
        )
    except LookupError as err:
        raise ValidationError(str(err))
    except MultiplePathsFound as err:
        raise ValidationError(str(err))

    return api_path
509623
def getattr_path(obj, path):
    
    path = path.split('__')
    for name in path:
        obj = getattr(obj, name)
        if obj is None:
            return None
    return obj
1034108
def get_url(path, host, port, method="http"):
    
    return urlunsplit(
        (method, "%s:%s" % (host, port), path, "", "")
    )
582979
def _get_path(dict_, path):
    '''
    
    '''
    cur = dict_
    for part in path.split('/'):
        cur = cur[part]
    return cur
403993
def url2path(url):
	
	scheme, host, path, nul, nul, nul = urlparse(url)
	if scheme.lower() in ("", "file") and host.lower() in ("", "localhost"):
		return path
	raise ValueError(url)
411474
def parse_callable(path: str) -> Iterator:
    
    module = path[: path.rindex(".")]
    callable_name = path[path.rindex(".") + 1 :]
    callable_ = getattr(importlib.import_module(module), callable_name)
    return callable_()
301116
def url_join(url, path):
    
    p = six.moves.urllib.parse.urlparse(url)

    t = None
    if p.path and p.path[-1] == '/':
        if path and path[0] == '/':
            path = path[1:]
        t = ''.join([p.path, path])
    else:
        t = ('' if path and path[0] == '/' else '/').join([p.path, path])

    return six.moves.urllib.parse.urlunparse(
        p[:2]+
        (t,)+ # os.sep is different on windows, don't use it here.
        p[3:]
    )
542693
def _determine_path
      path = File.expand_path('../..', __FILE__)

      # Will be something like:
      # "/path/to/file.rb:47:in `method_name'"
      non_announcer_caller = caller.find { |c| !c.start_with?(path) }

      unless non_announcer_caller
        # This is not expected to occur.
        raise Errors::SubscriptionError, "Could not find non-Announcer caller"
      end

      non_announcer_caller
    end
345228
def match(self, request, *, root=None, path=None, methods=None):
        
        return self.__router.match(
            request, root=root, path=path, methods=methods)
1067548
def for(path, *args)
      arg = args[0]
      log.debug "Adding route, path: #{path}, args: #{args.inspect}"

      match = get_regex_for_route(path, arg)
      hash = get_to_hash(arg)
      route_info = {:regex => match[:regex], :args => arg, :vars => match[:vars], :hash => hash}
      
      # Add the HTTP methods for this route if they exist in options
      route_info[:methods] = arg[:methods] if not arg.nil? and arg.has_key? :methods
      
      self.routes.push(route_info)
    end
1095883
def match(self, environ):
        '''  '''
        targets, urlargs = self._match_path(environ)
        if not targets:
            raise HTTPError(404, "Not found: " + repr(environ['PATH_INFO']))
        method = environ['REQUEST_METHOD'].upper()
        if method in targets:
            return targets[method], urlargs
        if method == 'HEAD' and 'GET' in targets:
            return targets['GET'], urlargs
        if 'ANY' in targets:
            return targets['ANY'], urlargs
        allowed = [verb for verb in targets if verb != 'ANY']
        if 'GET' in allowed and 'HEAD' not in allowed:
            allowed.append('HEAD')
        raise HTTPError(405, "Method not allowed.",
                        header=[('Allow',",".join(allowed))])
54988
def match_pattern(self, path):
        
        for pattern in self.__pattern:
            if len(fnmatch.filter([path], pattern)) > 0:
                return True
        return False
1214364
def find_by_localpath(self, path):
        
        # note that the paths in self.jsondata were already _homepath2real()'d
        # in the class' __init__()
        resolved = _homepath2real(path)
        for row in self.jsondata:
            if resolved == os.path.realpath(row["localpath"]):
                return self._infofromdict(row)