Constructs absolute URL from Request object.
518369
public function constructUrl(Request $appRequest, Nette\Http\Url $refUrl): ?string
	{
		$baseUrl = $refUrl->getHostUrl();
		
		$path = $this->pathMatcher->createUrl($this->route, $appRequest->getParameters());
		
		if ($path === null) {
			throw new RouteException('There was an error on constructing url with: ' . $this->route);
		}
		
		return $baseUrl . '/' . $path;
		
	}
761252
def url(self, request=""):
        """"""
        if request.startswith("/"):
            request = request[1:]
        return "{}://{}/{}".format(self.scheme, self.host, request)
437806
def urljoin (parent, url):
    
    if urlutil.url_is_absolute(url):
        return url
    return urlparse.urljoin(parent, url)
1069010
def from_request(cls, http_method, http_url, headers=None, parameters=None,
            query_string=None):
        """"""
        if parameters is None:
            parameters = {}
 
        # Headers
        if headers:
            auth_header = None
            for k, v in headers.items():
                if k.lower() == 'authorization' or \
                    k.upper() == 'HTTP_AUTHORIZATION':
                    auth_header = v

            # Check that the authorization header is OAuth.
            if auth_header and auth_header[:6] == 'OAuth ':
                auth_header = auth_header[6:]
                try:
                    # Get the parameters from the header.
                    header_params = cls._split_header(auth_header)
                    parameters.update(header_params)
                except:
                    raise Error('Unable to parse OAuth parameters from '
                        'Authorization header.')
 
        # GET or POST query string.
        if query_string:
            query_params = cls._split_url_string(query_string)

            parameters.update(query_params)
 
        # URL parameters.
        param_str = urlparse(http_url)[4] # query
        url_params = cls._split_url_string(param_str)
        parameters.update(url_params)
 
        if parameters:
            return cls(http_method, http_url, parameters)
 
        return None
1230720
def _url(self, uri):
        """"""
        prefix = "{}://{}{}".format(
            self._protocol,
            self.real_connection.host,
            self._port_postfix(),
        )
        return uri.replace(prefix, '', 1)
284904
def construct_url(ip_address: str) -> str:
    """"""
    if 'http://' not in ip_address and 'https://' not in ip_address:
        ip_address = '{}{}'.format('http://', ip_address)
    if ip_address[-1] == '/':
        ip_address = ip_address[:-1]
    return ip_address
560538
def rel_to_abs(self, base_url):
        
        self.cleaned_css = self.rel_to_abs_re.sub(
            lambda match: "url('%s')" % urljoin(
                base_url, match.group('path').strip('\'"')),
            self.cleaned_css)
1153110
def parse_url(request, url):
    """"""
    try:
        validate = URLValidator()
        validate(url)
    except ValidationError:
        if url.startswith('/'):
            host = request.get_host()
            scheme = 'https' if request.is_secure() else 'http'
            url = '{scheme}://{host}{uri}'.format(scheme=scheme,
                                                  host=host,
                                                  uri=url)
        else:
            url = request.build_absolute_uri(reverse(url))
    return url
639272
public function createAbsoluteUrl($uri, $query_params = [], $ssl = false, $port = 80, $request = null)
    {
        if ($this->isSingle()) {
            return UrlManager::createAbsoluteUrl($uri, $query_params, $ssl, $port, $request);
        }
        return '';
    }
759999
def makeMNBaseURL(url):
    """"""
    o = urllib.parse.urlparse(url, scheme=d1_common.const.DEFAULT_MN_PROTOCOL)
    if o.netloc and o.path:
        netloc = o.netloc
        path = o.path
    elif o.netloc:
        netloc = o.netloc
        path = d1_common.const.DEFAULT_MN_PATH
    elif o.path:
        s = o.path.split('/', 1)
        netloc = s[0]
        if len(s) == 1:
            path = d1_common.const.DEFAULT_MN_PATH
        else:
            path = s[1]
    else:
        netloc = d1_common.const.DEFAULT_MN_HOST
        path = d1_common.const.DEFAULT_MN_PATH
    return urllib.parse.urlunparse(
        (o.scheme, netloc, path, o.params, o.query, o.fragment)
    )
1235001
def build_absolute_uri(request, location, protocol=None):
    
    from .account import app_settings as account_settings

    if request is None:
        site = Site.objects.get_current()
        bits = urlsplit(location)
        if not (bits.scheme and bits.netloc):
            uri = '{proto}://{domain}{url}'.format(
                proto=account_settings.DEFAULT_HTTP_PROTOCOL,
                domain=site.domain,
                url=location)
        else:
            uri = location
    else:
        uri = request.build_absolute_uri(location)
    # NOTE: We only force a protocol if we are instructed to do so
    # (via the `protocol` parameter, or, if the default is set to
    # HTTPS. The latter keeps compatibility with the debatable use
    # case of running your site under both HTTP and HTTPS, where one
    # would want to make sure HTTPS links end up in password reset
    # mails even while they were initiated on an HTTP password reset
    # form.
    if not protocol and account_settings.DEFAULT_HTTP_PROTOCOL == 'https':
        protocol = account_settings.DEFAULT_HTTP_PROTOCOL
    # (end NOTE)
    if protocol:
        uri = protocol + ':' + uri.partition(':')[2]
    return uri
23204
def make_absolute_url(url)
      return url unless URI.parse(url).relative?
      begin
        URI.parse(@page_url).merge(url).to_s
      rescue URI::Error
        url
      end
    end
972352
def absolute_url
      assert_exists
      href = @object.getAttribute('href')

      unless href.empty? || URI.parse(href).absolute?
        href = URI.join(browser.url, href).to_s
      end

      href
    end
361791
def resolve_url(href_str, absolute_url_str)
      if absolute_url_str.class <= URI::Generic
        absolute_url = absolute_url_str.dup
      else
        begin
          absolute_url = URI(absolute_url_str).dup
        rescue URI::InvalidURIError
          raise ArgumentError, "#{absolute_url_str} must be represent a valid relative or absolute URI" 
        end
      end
      raise ArgumentError, "#{absolute_url} must be absolute" unless absolute_url.absolute?
      if href_str.class <= URI::Generic
        href = href_str.dup
      else
        begin
          href = URI(href_str).dup
        rescue URI::InvalidURIError
          raise ArgumentError, "#{href_str} must be represent a valid relative or absolute URI"
        end
      end

      # return :href if :href is already absolute
      return href.to_s if href.absolute?

      #TODO: edge cases, see [issue #8](https://github.com/propublica/upton/issues/8)
      URI.join(absolute_url.to_s, href.to_s).to_s
    end
557440
function getURLFromRequest(request) {
	const queryString = makeQueryString(request.query || {});
	let formatted = request.route;
	let value;
	let regexp;

	// Replace route params with their values. If the route param is specified
	// with an extension (e.g., ':id.json'), keep the extension.
	Object.keys(request.params || {}).forEach((name) => {
		value = request.params[name];
		regexp = new RegExp(':' + name + '(?=(?:\\.|\\/|$|\\?))');
		formatted = formatted.replace(regexp, value);
	});

	return formatted + (queryString ? '?' + queryString : '');
}
539383
def FinalizeTransferUrl(self, url):
        """"""
        url_builder = _UrlBuilder.FromUrl(url)
        if self.global_params.key:
            url_builder.query_params['key'] = self.global_params.key
        return url_builder.url
387269
def relative(self):
        
        if not self.is_absolute():
            raise ValueError("URL should be absolute")
        val = self._val._replace(scheme="", netloc="")
        return URL(val, encoded=True)