Get 'Base URL' from the configuration. If the base URL ends with '/',
it is dropped.
515288
private static String createBaseUrl(AuthleteConfiguration configuration)
    {
        String baseUrl = configuration.getBaseUrl();

        // If the configuration does not contain a base URL.
        if (baseUrl == null)
        {
            throw new IllegalArgumentException("The configuration does not have information about the base URL.");
        }

        try
        {
            // Check whether the format of the given URL is valid.
            new URL(baseUrl);
        }
        catch (MalformedURLException e)
        {
            // The format of the base URL is wrong.
            throw new IllegalArgumentException("The base URL is malformed.", e);
        }

        if (baseUrl.endsWith("/"))
        {
            // Drop the '/' at the end of the URL.
            return baseUrl.substring(0, baseUrl.length() - 1);
        }
        else
        {
            // Use the value of the base URL without modification.
            return baseUrl;
        }
    }
786437
def get_api_url(server):
    
    parsed = urlparse(server)
    base_url = parsed.netloc if parsed.netloc else parsed.path
    base_url.replace('/', '')
    return 'https://' + base_url + '/apiv1'
472630
function() {
            var args = Array.prototype.slice.call(arguments, 0);
            args.splice(0,0, configs.staticDirectory);
            return Urls.base.apply(Urls, args);
        }
463236
def _get_base():
        
        try:
            name, _aliaslist, _addresslist = socket.gethostbyname_ex('deploy')
        except socket.gaierror:
            name = 'deploy'
        fallback = 'https://{name}/'.format(name=name)
        return os.environ.get('VELOCIRAPTOR_URL', fallback)
65992
def sub_base_uri(self):
        
        return self.base_uri and self.base_uri.split('://')[-1].split('.')[
            0] or self.base_uri
376125
private String getMetricsBaseUrl(String suppliedBaseUrl, String envBaseUrl) {
        
        String result = ("".equals(suppliedBaseUrl))? envBaseUrl : suppliedBaseUrl;
        logger.debug("getMetricsBaseUrl(env={}, supplied={}) = {}", envBaseUrl, suppliedBaseUrl, result);
        
        return result;
    }
193201
def get_url(params):
    """"""
    baseurl = 'http://{SUPERSET_WEBSERVER_ADDRESS}:{SUPERSET_WEBSERVER_PORT}/'.format(
        **app.config)
    with app.test_request_context():
        return urllib.parse.urljoin(
            baseurl,
            url_for('Superset.explore_json', **params),
        )
766614
def clean_base_uri(url):
        
        if url is None:
            return url
        if not '//' in url:
            url = 'https://' + url

        ret = url[:url.find('/', url.find('//') + 2) + 1] or url
        assert '.' in url, "<%s> is not a proper base_uri" % ret

        if not ret.endswith('/'):
            ret += '/'
        return ret
872325
def get_url(self, cmd, **args):
        """"""
        return self.http.base_url + self._mkurl(cmd, *args)
147037
function getPath() {
  var p = info && info.config ? info.config : './config'
  if (p.charAt(0) === '/') return p
  return path.join(base, p)
}
1325726
protected function _getAppBase()
    {
        $baseUrl = Configure::read('App.base');
        if (!$baseUrl) {
            $request = Router::getRequest(true);
            if (!$request) {
                $baseUrl = '';
            } else {
                $baseUrl = $request->base;
            }
        }
        return $baseUrl . '/';
    }
579096
function() {
      var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
      if (this.isNew()) return base;
      return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id);
    }
1334423
def _get_url_base(cls, url):
        
        s = urlsplit(url)
        return urlunsplit([s.scheme, s.netloc, '', '', ''])
75416
public function getBaseUrl()
    {
        $url = '';
        if (isset($this->scheme)) {
            if ('' !== $this->scheme) {
                $url .= $this->scheme . ':';
            }
            $url .= '//';
        }

        if (isset($this->user)) {
            $url .= $this->user;

            if (isset($this->pass)) {
                $url .= ':' . $this->pass;
            }

            $url .= '@';
        }

        $url .= $this->host;

        if (isset($this->port)) {
            $url .= ':' . $this->port;
        }

        if (isset($this->path)) {
            if ($url != '' && $this->path[0] !== '/') {
                $url .= '/';
            }

            $url .= $this->path;
        }

        return $url;
    }
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 + '/'
303085
def get_base_url(config, url):
    
    if not config:
        return None

    # First, try to search for the best match
    for item in config:
        if url.startswith(item):
            return item

    # Then search for indirect match
    for item in config:
        if without_http_prefix(url).startswith(without_http_prefix(item)):
            return item
1290940
def _get_url(self, resource, item, sys_id=None):
        

        url_str = '%(base_url)s/%(base_path)s/%(resource)s/%(item)s' % (
            {
                'base_url': self.base_url,
                'base_path': self.base_path,
                'resource': resource,
                'item': item
            }
        )

        if sys_id:
            return "%s/%s" % (url_str, sys_id)

        return url_str