Build a LendingClub URL from a URL path (without the domain).

        Parameters
        ----------
        path : string
            The path part of the URL after the domain. i.e. https://www.lendingclub.com/<path>
770541
def build_url(self, path):
        
        url = '{0}{1}'.format(self.base_url, path)
        url = re.sub('([^:])//', '\\1/', url)  # Remove double slashes
        return url
414484
def extract_path(url_hash)
      path_parts = url_hash[:url_f].split('//').last.split('/')[1..-1]
      path = "/#{path_parts.join('/')}"
      if path&.length > 2
        url_hash[:url_path] = path
        url_hash[:url_f] = url_hash[:url_f].gsub(url_hash[:url_path], '')
      end
      url_hash
    end
1226759
def relpath(self, path):
        
        for root in self.roots:
            # Root is regex, convert to matching root string
            if isinstance(root, Pattern):
                match = root.match(path)
                if not match:
                    continue
                root = match.group(0)

            # Split root and relative path
            try:
                relative = path.split(root, 1)[1]
                # Strip "/" only at path start. "/" is used to known if
                # path is a directory on some cloud storage.
                return relative.lstrip('/')
            except IndexError:
                continue

        return path
667498
def _build_url(cls, request, path=None, **changes):
        
        changes = {k: v for k, v in changes.items() if v is not None}
        queries = {**request.url.query, **changes}
        queries = {k: v for k, v in queries.items() if v is not False}
        query_strings = []

        def add_query(key):
            query_strings.append('{}={}'.format(key, queries[key])
                                 if queries[key] != '' else key)

        def del_query(key):
            queries.pop(key, None)

        if 'head' in queries:
            add_query('head')
            del_query('head')

        if 'start' in changes:
            add_query('start')
        elif 'start' in queries:
            add_query('start')

        del_query('start')

        if 'limit' in queries:
            add_query('limit')
            del_query('limit')

        for key in sorted(queries):
            add_query(key)

        scheme = cls._get_forwarded(request, 'proto') or request.url.scheme
        host = cls._get_forwarded(request, 'host') or request.host
        forwarded_path = cls._get_forwarded(request, 'path')
        path = path if path is not None else request.path
        query = '?' + '&'.join(query_strings) if query_strings else ''

        url = '{}://{}{}{}{}'.format(scheme, host, forwarded_path, path, query)
        return url
978429
def address_from_path(self, path=None):
        
        path = path if path else self._unique_hierarchical_string()
        return path, self.wallet.subkey_for_path(path).address()
1093059
def from_path(self, complete_path, lang, exclude_drafts=True):
        """"""
        if complete_path.endswith("/"):
            complete_path = complete_path[:-1]
        # just return the root page
        if complete_path == '':
            root_pages = self.root()
            if root_pages:
                return root_pages[0]
            else:
                return None

        slug = get_slug(complete_path)
        from pages.models import Content
        page_ids = Content.objects.get_page_ids_by_slug(slug)
        pages_list = self.on_site().filter(id__in=page_ids)
        if exclude_drafts:
            pages_list = pages_list.exclude(status=self.model.DRAFT)
        if len(pages_list) == 1:
            if(settings.PAGE_USE_STRICT_URL and
                    pages_list[0].get_complete_slug(lang) != complete_path):
                return None
            return pages_list[0]
        # if more than one page is matching the slug,
        # we need to use the full URL
        if len(pages_list) > 1:
            for page in pages_list:
                if page.get_complete_slug(lang) == complete_path:
                    return page
        return None
1350819
def from_url(cls, path):
        
        if os.path.isfile(path):
            with open(path) as fd:
                data = fd.read()
        else:
            try:
                response = urllib.urlopen(path)
                if response.code >= 300:
                    raise RuntimeError('Unable to load repo from %s' % path)

                data = response.read()
                response.close()
            except IOError:
                raise RuntimeError(
                    'Unable to load repo from %s (IO error)' % path
                )

        return cls(json.loads(data), path)
573506
function url(path) {
        if (path) {
            if (_.startsWith(path, "/")) {
                if (!_urlPrefix) {
                    // lets discover the base url via the base html element
                    _urlPrefix = $('base').attr('href') || "";
                    if (_.endsWith(_urlPrefix, '/')) {
                        _urlPrefix = _urlPrefix.substring(0, _urlPrefix.length - 1);
                    }
                }
                if (_urlPrefix) {
                    return _urlPrefix + path;
                }
            }
        }
        return path;
    }
880460
def _build_url(self, resource, **kwargs):
        # type: (str, **str) -> str
        """"""
        return urljoin(self.api_root, API_PATH[resource].format(**kwargs))
1069289
def _build_path(self):
        '''
        

        '''
        if not self.path:
            self.path = '/'

        if self.uri_parameters:
            self.path = self.path + ';' + requote_uri(self.uri_parameters)

        if self.query:
            self.path = (self.path + '?' + self.query)

        if self.params:
            try:
                if self.query:
                    self.path = self.path + self._dict_to_query(
                        self.params, base_query=True)
                else:
                    self.path = self.path + self._dict_to_query(self.params)
            except AttributeError:
                self.path = self.path + '?' + self.params

        self.path = requote_uri(self.path)

        self.req_url = urlunparse(
            (self.scheme, self.host, (self.path or ''), '', '', ''))
380887
def get_url(self, **kwargs):
        

        return build(
            self._request.path,
            self._request.GET,
            self._meta.prefix,
            **kwargs )
96929
def make_path_relative(path: str) -> str:
    
    if "../" in path:
        raise ManifestBuildingError(
            f"Path: {path} appears to be outside of the virtual source tree. "
            "Please make sure all sources are within the virtual source tree root directory."
        )

    if path[:2] != "./":
        return f"./{path}"
    return path
1018045
def path(self, path):
        
        if os.path.isabs(path):
            return path
        return os.path.join(self.location, path)
1040111
def add_path_part(url, regex=PATH_PART):
    
    formatter = string.Formatter()
    url_var_template = "(?P<{var_name}>{regex})"

    for part in formatter.parse(url):
        string_part, var_name, _, _ = part
        if string_part:
            yield string_part
        if var_name:
            yield url_var_template.format(var_name=var_name, regex=regex)
4815
def get_path_url(path, relative=False):
    
    if relative:
        return os.path.relpath(path)
    else:
        return 'file://%s' % os.path.abspath(path)
1341668
def make_url(url, *paths):
    
    for path in paths:
        url = re.sub(r'/?$', re.sub(r'^/?', '/', path), url)
    return url
419151
def url_path(request, base_url=None, is_full=False, *args, **kwargs):
    
    if not base_url:
        base_url = request.path
        if is_full:
            protocol = 'https' if request.is_secure() else 'http'
            base_url = '%s://%s%s' % (protocol, request.get_host(), base_url)

    params = url_params(request, *args, **kwargs)
    url = '%s%s' % (base_url, params)
    return url