>>> c = Cube('cube.mydomain.com')
        >>> print(c.get_base_url())
        http://cube.mydomain.com:1081/1.0
762034
def get_base_url(self):
        
        return "http://{hostname}:{port}/{api}".format(
                hostname=self.hostname,
                port=self.port,
                api=self.api_version)
518207
def base_url(klass, space_id, resource_id=None, public=False, environment_id=None, **kwargs):
        

        if public:
            environment_slug = ""
            if environment_id is not None:
                environment_slug = "/environments/{0}".format(environment_id)
            return "spaces/{0}{1}/public/content_types".format(space_id, environment_slug)
        return super(ContentType, klass).base_url(
            space_id,
            resource_id=resource_id,
            environment_id=environment_id,
            **kwargs
        )
494228
def _get_request_url(self, instance, url):
        
        parsed = urlparse(url)

        _url = url
        if not (parsed.netloc and parsed.scheme) and is_affirmative(instance.get('spark_proxy_enabled', False)):
            master_address = self._get_master_address(instance)
            _url = urljoin(master_address, parsed.path)

        self.log.debug('Request URL returned: %s', _url)
        return _url
8723
def base_url(self):
        
        return get_current_url(
            self.environ, strip_querystring=True, trusted_hosts=self.trusted_hosts
        )
65992
def sub_base_uri(self):
        
        return self.base_uri and self.base_uri.split('://')[-1].split('.')[
            0] or self.base_uri
652653
def object_url(self, object_t, object_id=None, relation=None, **kwargs):
        
        if object_t not in self.objects_types:
            raise TypeError("{} is not a valid type".format(object_t))
        request_items = (
            str(item) for item in [object_t, object_id, relation] if item is not None
        )
        request = "/".join(request_items)
        base_url = self.url(request)
        if self.access_token is not None:
            kwargs["access_token"] = str(self.access_token)
        if kwargs:
            for key, value in kwargs.items():
                if not isinstance(value, str):
                    kwargs[key] = str(value)
            # kwargs are sorted (for consistent tests between Python < 3.7 and >= 3.7)
            sorted_kwargs = SortedDict.from_dict(kwargs)
            result = "{}?{}".format(base_url, urlencode(sorted_kwargs))
        else:
            result = base_url
        return result
1244676
def url(self):
        """"""
        if self.parent is None:
            # TODO: differing API Versions?
            pieces = [self.client.base_url, 'api', 'atlas', 'v2']
        else:
            pieces = [self.parent.url]

        pieces.append(self.model_class.path)
        return '/'.join(pieces)
180837
def build_url(self):
        
        url = "%s/1.0/%s/%s/%s" % (
            self.request.endpoint.get_url(),
            self.request.api_object,
            self.request.api_method,
            to_hex(self.request.nonce)
        )
        return url
505655
def _url(self):
        """"""
        base_url = self._client._url.rstrip('/')
        return '{}/instances/{}/acls/{}/'.format(base_url, self.instance_name, self.id)
860427
def base_url(self, value):
        """"""
        logger.debug('StackInABox({0}): Updating URL from {1} to {2}'
                     .format(self.__id, self.__base_url, value))
        self.__base_url = value
        for k, v in six.iteritems(self.services):
            matcher, service = v
            service.base_url = StackInABox.__get_service_url(value,
                                                             service.name)
            logger.debug('StackInABox({0}): Service {1} has url {2}'
                         .format(self.__id, service.name, service.base_url))
589961
public static function getBaseUrl()
    {
        if (empty(self::$base) && defined('BASE_URL')) {
            self::$base = BASE_URL;
            if (!preg_match("/\/$/", self::$base)) {
                self::$base .= '/';
            }
        }

        return self::$base;
    }
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 + '/'
184920
def show_url(context, **kwargs):
    """"""
    if len(kwargs) != 2:
        raise TemplateSyntaxError(_('"show_url" tag takes exactly two keyword arguments.'))
    request = context['request']
    current_site = get_current_site(request)
    url = add_domain(current_site.domain, kwargs['url'])
    return re.sub(r'https?:\/\/', '%s://' % kwargs['protocol'], url)
185995
def get_services_url(url, base_url):
        
        length = len(base_url)
        checks = ['http://', 'https://']
        for check in checks:
            if url.startswith(check):
                length = length + len(check)
                break

        result = url[length:]
        logger.debug('{0} from {1} equals {2}'
                     .format(base_url, url, result))
        return result
108383
def url(self):
        """"""
        return self.get_url(self.id, self.world) if self.id and self.world else None
482210
def makeCNBaseURL(url):
    """"""
    o = urllib.parse.urlparse(url, scheme=d1_common.const.DEFAULT_CN_PROTOCOL)
    if o.netloc and o.path:
        netloc = o.netloc
        path = o.path
    elif o.netloc:
        netloc = o.netloc
        path = d1_common.const.DEFAULT_CN_PATH
    elif o.path:
        s = o.path.split('/', 1)
        netloc = s[0]
        if len(s) == 1:
            path = d1_common.const.DEFAULT_CN_PATH
        else:
            path = s[1]
    else:
        netloc = d1_common.const.DEFAULT_CN_HOST
        path = d1_common.const.DEFAULT_CN_PATH
    return urllib.parse.urlunparse(
        (o.scheme, netloc, path, o.params, o.query, o.fragment)
    )
426724
def get_subdomain(url):
        

        if url not in URLHelper.__cache:
            URLHelper.__cache[url] = urlparse(url)

        return ".".join(URLHelper.__cache[url].netloc.split(".")[:-2])