Takes an optional URL, relative to the applications root, and returns a fully qualified URL.
 Example: url('/example?show=30') #=> https://localhost:9292/myapp/example?show=30
767217
def url(path = nil, scheme: nil)
      return path if path && URI.parse(path).scheme
      uri = URI::Generic.build(
        scheme: scheme || env['rack.url_scheme'],
        host: env['SERVER_NAME'],
        port: env['SERVER_PORT'].to_i,
        path: env['scorched.root_path'],
      )
      if path
        path[0,0] = '/' unless path[0] == '/'
        uri.to_s.chomp('/') << path
      else
        uri.to_s
      end
    end
293294
def url(self, url):
        
        if url and url.endswith('/'):
            url = url[:-1]

        self._url = url
1229570
def get_app_url(self):
        
        section = 'server:main'
        if self.has_setting(section, 'host'):
            host = self.get_setting(section, 'host')
        else:
            host = '0.0.0.0'
        if self.has_setting(section, 'port'):
            port = int(self.get_setting(section, 'port'))
        else:
            port = 6543
        return 'http://%s:%d' % (host, port)
430752
def get_absolute_url(self):
        
        try:
            url = reverse("content-detail-view", kwargs={"pk": self.pk, "slug": self.slug})
        except NoReverseMatch:
            url = None
        return url
802561
def url(self, **urlargs):
        '''
        '''
        if self.defaults:
            d = self.defaults.copy()
            d.update(urlargs)
            urlargs = d
        url = '/'.join(self._url_generator(urlargs))
        if not url:
            return '/'
        else:
            url = '/' + url
            return url if self.is_leaf else url + '/'
775711
def absolutify_url(src, base_url, parent_url)
      if src.nil? || src.empty? || src == "//:" || src =~ /\s*http:\/\//i
        return src
      end

      return "#{base_url}#{src}" if src =~ /^\s*\//
      return "#{parent_url}#{src}" if parent_url
      return src
    end
1289630
def root(self, request, url):
        
        self.root_url = request.path[:len(request.path) - len(url)]
        url = url.rstrip('/')  # Trim trailing slash, if it exists.

        if url == '':
            return self.index(request)
        elif '/' in url:
            return self.model_page(request, *url.split('/', 2))

        raise http.Http404('The requested databrowse page does not exist.')
789494
private static URL uriToURL(final URI uri) {
        if (uri.getScheme().equals("jrt")) {
            // Currently URL cannot handle the "jrt:" scheme, used by system modules.
            throw new IllegalArgumentException("Could not create URL from URI with \"jrt:\" scheme: " + uri);
        }
        try {
            return uri.toURL();
        } catch (final MalformedURLException e) {
            throw new IllegalArgumentException("Could not create URL from URI: " + uri + " -- " + e);
        }
    }
640883
function urlToUri(url) {
  let parts;

  if (!isUrl(url)) {
    throw new Error('Invalid url ' + url);
  }
  parts = urlParse.parse(url);

  return `${parts.hostname}${decodeURIComponent(parts.path)}`;
}
1063852
def base_url(self):
        ''''''
        config_value = self.config.get('url')
        if config_value:
            return self._clean_url(config_value)
        default_url = current_app.config.get('FS_URL')
        default_url = current_app.config.get('{0}URL'.format(self.backend_prefix), default_url)
        if default_url:
            url = urljoin(default_url, self.name)
            return self._clean_url(url)
        return url_for('fs.get_file', fs=self.name, filename='', _external=True)
613275
def _extractPathFromUrl(url):
        
        if url.netloc != '' and url.netloc != 'localhost':
            raise RuntimeError("The URL '%s' is invalid" % url.geturl())
        return url.netloc + url.path
952745
def full_url(self):
        """"""
        if self.needs_auth:
            netloc = '%s:%s@%s' % (self.username, self.password, self.netloc)
        else:
            netloc = self.netloc
        return urlunparse((
            self.scheme,
            netloc,
            self.path,
            self.params,
            self.query,
            self.fragment,
        ))
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
1320716
def absolute_url(self):
        
        if self.is_root():
            return utils.concat_urls(self.url)
        return utils.concat_urls(self.parent.absolute_url, self.url)
344369
def website(app=None, mode='home', subcontext='UserGuide'):
    
    base_url = WEBSITES.get(mode, '')

    if app and base_url:
        opts = {'app': app, 'base_url': base_url}
        base_url = SUBCONTEXT_MAP.get((mode, subcontext), base_url)
        base_url %= opts

    return base_url
681227
function getCurrentUrl() {
	var root = cleanRoot(),
		location = LOCATION(),
		loc = (location.pathname + location.search),
		index = loc.indexOf(root);

	return loc.substr(index + root.length);
}
826405
def get_base_url(url, include_path=False):
    

    if not url:
        return None

    parts = _urlsplit(url)
    base_url = _urlunsplit((
        parts.scheme, parts.netloc, (parts.path if include_path else ''), None, None
    ))

    return base_url if base_url.endswith('/') else base_url + '/'