Return the base URL for Gluon dataset and model repository.
557194
def _get_repo_url():
    """"""
    default_repo = 'https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/'
    repo_url = os.environ.get('MXNET_GLUON_REPO', default_repo)
    if repo_url[-1] != '/':
        repo_url = repo_url+'/'
    return repo_url
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)
505062
def get_generator():
    
    g_net = gluon.nn.Sequential()
    with g_net.name_scope():

        g_net.add(gluon.nn.Conv2DTranspose(
            channels=512, kernel_size=4, strides=1, padding=0, use_bias=False))
        g_net.add(gluon.nn.BatchNorm())
        g_net.add(gluon.nn.LeakyReLU(0.2))

        g_net.add(gluon.nn.Conv2DTranspose(
            channels=256, kernel_size=4, strides=2, padding=1, use_bias=False))
        g_net.add(gluon.nn.BatchNorm())
        g_net.add(gluon.nn.LeakyReLU(0.2))

        g_net.add(gluon.nn.Conv2DTranspose(
            channels=128, kernel_size=4, strides=2, padding=1, use_bias=False))
        g_net.add(gluon.nn.BatchNorm())
        g_net.add(gluon.nn.LeakyReLU(0.2))

        g_net.add(gluon.nn.Conv2DTranspose(
            channels=64, kernel_size=4, strides=2, padding=1, use_bias=False))
        g_net.add(gluon.nn.BatchNorm())
        g_net.add(gluon.nn.LeakyReLU(0.2))

        g_net.add(gluon.nn.Conv2DTranspose(channels=3, kernel_size=4, strides=2, padding=1, use_bias=False))
        g_net.add(gluon.nn.Activation('tanh'))

    return g_net
8723
def base_url(self):
        
        return get_current_url(
            self.environ, strip_querystring=True, trusted_hosts=self.trusted_hosts
        )
855311
def public_url(self):
        
        return "{storage_base_url}/{bucket_name}/{quoted_name}".format(
            storage_base_url=_API_ACCESS_ENDPOINT,
            bucket_name=self.bucket.name,
            quoted_name=quote(self.name.encode("utf-8")),
        )
1016468
def _url(self):
        """"""
        if self.ID_NAME not in self.route.keys() and "id" in self.data.keys():
            self.route[self.ID_NAME] = self.data["id"]
        return self.config.BASE + self.PATH.format(**self.route)
1139677
def get_d1_env_by_base_url(cn_base_url):
    """"""
    for k, v in D1_ENV_DICT:
        if v['base_url'].startswith(cn_base_url):
            return D1_ENV_DICT[k]
99868
def build_url(self, *args, **kwargs):
        """"""
        parts = [kwargs.get('base_url') or self.base_url]
        parts.extend(args)
        parts = [str(p) for p in parts]
        key = tuple(parts)
        __logs__.info('Building a url from %s', key)
        if not key in __url_cache__:
            __logs__.info('Missed the cache building the url')
            __url_cache__[key] = '/'.join(parts)
        return __url_cache__[key]
194784
def get_url(self, fname):
        
        self._assert_file_in_registry(fname)
        return self.urls.get(fname, "".join([self.base_url, fname]))
1149648
def get_institution_url(base_url):
    
    base_url = base_url.rstrip('/')
    index = base_url.find('/api/v1')

    if index != -1:
        return base_url[0:index]

    return base_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 + '/'
1334781
def base_url(self, url):
        """"""
        parts = list(self.parse_url(url))
        parts[4:] = ['' for i in parts[4:]]
        return urlunparse(parts)
1307753
def base_url(self) -> str:
        """"""
        return urlunparse(ParseResult(self.scheme, self.host, self.path, '', '', ''))
669133
def get_model_url_base():
    '''
    
    '''
    url_base = get_model_url_base_from_env()
    if url_base is not None:
        logger.info('NNBLA_MODELS_URL_BASE is set as {}.'.format(url_base))
    else:
        url_base = 'https://nnabla.org/pretrained-models/nnp_models/'
    return url_base
365177
def getBaseUrl(self):
        ''''''
        components = util.splitpath(os.path.abspath(self.basepath))
        url = '/'.join([url_quote(component, '') for component in components])
        return 'file:///' + url + '/'
560510
def get_resource_url(self):
        

        name = self.__class__.resource_name
        url = self.__class__.rest_base_url()

        return "%s/%s" % (url, name)
588095
def get_repository(self, entity_cls):
        """"""
        model_cls = self.get_model(entity_cls)
        return DictRepository(self, entity_cls, model_cls)