generate base URL
976975
protected function baseUrl()
    {
        $path       = dirname($_SERVER['SCRIPT_NAME']);
        $path       = trim($path, '/');
        $baseUrl    = Request::getUrl();
        $baseUrl    = trim($baseUrl, '/');
        return $baseUrl.'/'.$path.( $path ? '/' : '' );
    }
318744
def construct_url(self):
        """"""
        path = [self.path]
        path.extend(self.params)

        # Build URL
        url = self.client.base_url + '/'.join(
            str(value) for value in path
            if value
        )

        # Append query parameters (if defined)
        query = self.encode_query(self.query)

        if query:
            url += '?' + query

        return url
1171632
def _get_base_url(request):
    
    if request.is_secure():
        base_url = 'https://%s'
    else:
        base_url = 'http://%s'
    base_url %= request.META['HTTP_HOST']
    return base_url
1018885
def add_url (self, url, line=0, column=0, page=0, name=u"", base=None):
        """"""
        if base:
            base_ref = urlutil.url_norm(base)[0]
        else:
            base_ref = None
        url_data = get_url_from(url, self.recursion_level+1, self.aggregate,
            parent_url=self.url, base_ref=base_ref, line=line, column=column,
            page=page, name=name, parent_content_type=self.content_type)
        self.aggregate.urlqueue.put(url_data)
393553
def url(self, action, **kwargs):
        
        # TODO : should be static method ?
        return self.URLS['BASE'] % self.URLS[action] % kwargs
1179000
public static String newUrl(final String baseUrl, 
        final Collection<Pair<String, String>> params)
        {
        final StringBuilder sb = new StringBuilder();
        sb.append(baseUrl);
        sb.append(getUrlParameters(params, true));
        return sb.toString();
        }
474284
public function addBaseUrlScript()
    {
        // Add base Url and absolute base Url to the head
        $arrJsPosHEad = empty($this->js[static::POS_HEAD]) ? [] : $this->js[static::POS_HEAD];
        array_unshift($arrJsPosHEad,
            "var absoluteBaseUrl = \"" . Yii::$app->urlManager->createAbsoluteUrl('site/index') . "\";");
        array_unshift($arrJsPosHEad, "var baseUrl = \"" . Yii::$app->urlManager->baseUrl . "\";");
        $this->js[static::POS_HEAD] = $arrJsPosHEad;
    }
832043
def _get_url_base(self, url):
        
        s = urlsplit(url)
        return urlunsplit([s.scheme, s.netloc, '', '', ''])
1334781
def base_url(self, url):
        """"""
        parts = list(self.parse_url(url))
        parts[4:] = ['' for i in parts[4:]]
        return urlunparse(parts)
229978
def site_url(url):
    
    base_url = 'http://%s' % socket.gethostname()

    if server.port is not 80:
        base_url += ':%d' % server.port

    return urlparse.urljoin(base_url, url)
535898
def build_url(base_url, path):
    
    if absolute_http_url_regexp.match(path):
        return path
    elif base_url:
        return "{}/{}".format(base_url.rstrip("/"), path.lstrip("/"))
    else:
        raise ParamsError("base url missed!")
748092
def make_url(*args, **kwargs):
    """"""
    base = "/".join(args)
    if kwargs:
        return "%s?%s" % (base, urlencode(kwargs))
    else:
        return base
990578
public function baseUrl()
    {
        if (!$this->baseUrl) {
            $this->baseUrl = $this->request->getScheme()
                . '://' . $this->request->getHttpHost();
        }
        return $this->baseUrl;
    }
1116009
def append_url(base_url, path):
    
    if base_url[-1] != "/":
        base_url += "/"
    if path[0] == "/":
        path = path[1:]
    return urljoin(base_url, path)
117696
def base_url(self, value):
        
        logger.debug('StackInABoxService ({0}:{1}) Updating Base URL '
                     'from {2} to {3}'
                     .format(self.__id,
                             self.name,
                             self.__base_url,
                             value))
        self.__base_url = value
        for k, v in six.iteritems(self.routes):
            v['regex'] = StackInABoxService.get_service_regex(
                value,
                v['uri'],
                v['handlers'].is_subservice)
682282
def generate_url(self, name: str, **kwargs) -> str:
        
        return self.urlmapper.generate(name, **kwargs)
103998
def base_url(root):
    """"""
    for attr, value in root.attrib.iteritems():
        if attr.endswith('base') and 'http' in value:
            return value
    return None