Build the URL to an asset.
333675
public function buildAssetUrl(string $path) : string {
        return starts_with($path, '//') ? $path : $this->app['url']->asset($path);
    }
830798
def build_url(self):
        """"""

        if not self.api_filters:
            return self.url

        # Reduce complex objects to simpler strings
        for k, v in self.api_filters.items():
            if isinstance(v, datetime):  # datetime > UNIX timestamp
                self.api_filters[k] = int(calendar.timegm(v.timetuple()))
            if isinstance(v, (tuple, list)):  # tuples & lists > x,y,z
                self.api_filters[k] = ",".join([str(_) for _ in v])

        if (
            self.id_filter in self.api_filters and
            len(str(self.api_filters[self.id_filter])) > self.URL_LENGTH_LIMIT
        ):
            self.build_url_chunks()
            return self.split_urls.pop(0)

        filters = '&'.join("%s=%s" % (k, v) for (k, v) in self.api_filters.items())

        return "%s?%s" % (self.url, filters)
60978
private static AssetLink createAssetLinkForImageAsset(long assetId) {
    AssetLink assetLink = new AssetLink();
    ImageAsset imageAsset = new ImageAsset();
    imageAsset.setAssetId(assetId);
    assetLink.setAsset(imageAsset);
    return assetLink;
  }
446525
def _construct_url(self, url, base, quote):
        
        if not base and not quote:
            return url
        else:
            url = url + base.lower() + quote.lower() + "/"
            return url
1266587
function loadAsset (asset, varName) {
  if (varName && typeof window[varName] !== 'undefined') {
    return Promise.resolve(window[varName]);
  }

  if (typeof asset === 'string') {
    if (/\.css$/.test(asset)) {
      asset = { src: asset, type: 'css' };
    } else {
      asset = { src: asset };
    }
  }

  var tag;
  if (asset.type === 'css') {
    tag = document.createElement('link');
    tag.setAttribute('rel', 'stylesheet');
    tag.setAttribute('href', asset.src);
  } else {
    tag = document.createElement('script');
    tag.setAttribute('type', 'text/javascript');
    tag.setAttribute('src', asset.src);
  }

  return new Promise(function (resolve) {
    tag.async = true;
    tag.onreadystatechange = tag.onload = function () {
      var state = tag.readyState;
      if (!state || /loaded|complete/.test(state)) {
        resolve(varName ? window[varName] : undefined);
      }
    };
    document.getElementsByTagName('head')[0].appendChild(tag);
  });
}
874893
function buildResourceHint (hint, asset, glob) {
  var as = ''

  if (hint === 'dns-prefetch' || hint === 'preconnect') {
    if (!urlMatch(asset, glob)) {
      return ''
    }

    asset = urlParse(asset)
    if (isDuplicate(asset, true)) {
      return ''
    }
  } else {
    if (!minimatch(asset, glob) || isDuplicate(asset)) {
      return ''
    }
    if (globMatch(asset, fonts)) {
      as += ' as="font"'
    } else if (isCSS(asset)) {
      as += ' as="style"'
    }
  }

  parsedAssets.push(asset)
  return `<link rel="${hint}" href="${asset}"${as} />`
}
713294
def build_absolute_uri(request, relative_url):
    """"""
    webroot = getattr(settings, 'WEBROOT', '')
    if webroot.endswith("/") and relative_url.startswith("/"):
        webroot = webroot[:-1]

    return request.build_absolute_uri(webroot + relative_url)
1217942
def get_asset_url(module: str, path: str) -> str:
    
    return '{}/{}/{}'.format(
        settings.STATIC_URL.rstrip('/'),
        module,
        path.lstrip('/'),
    )
964853
def url_for(self, *args: str, **kwargs: str) -> URL:
        """"""
        return self._resource.url_for(*args, **kwargs)
647232
def make_url(self, container=None, resource=None, query_items=None):
        """"""
        pth = [self._base_url]
        if container:
            pth.append(container.strip('/'))
        if resource:
            pth.append(resource)
        else:
            pth.append('')
        url = '/'.join(pth)
        if isinstance(query_items, (list, tuple, set)):
            url += RestHttp._list_query_str(query_items)
            query_items = None
        p = requests.PreparedRequest()
        p.prepare_url(url, query_items)
        return p.url
1144624
function requireAssets( requireFile, assetPaths, assetUrlPaths ) {
   return function( assets ) {
      return Promise.all( Object.keys( assets ).map( key => {
         const asset = assets[ key ];

         if( ( assetPaths || [] ).indexOf( key ) >= 0 ) {
            return requireFile( asset, 'content' )
               .then( content => ( { [ key ]: { content } } ) );
         }

         if( ( assetUrlPaths || [] ).indexOf( key ) >= 0 ) {
            return requireFile( asset, 'url' )
               .then( url => ( { [ key ]: { url } } ) );
         }

         return {};
      } ) ).then( merge );
   };
}
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]
37953
def build_url(self, _name, **kwargs):
        '''
        
        '''
        used_args, subreverse =  self._build_url_silent(_name, **kwargs)

        if set(kwargs).difference(used_args):
            raise UrlBuildingError(
                'Not all arguments are used during URL building: {}'\
                    .format(', '.join(set(kwargs).difference(used_args))))
        return subreverse.as_url
1127694
function assetPath(url) {
  const parsedUrl = path.parse(url.getValue());
  return compiler.types.String('url("' + parsedUrl.base + '")');
}
306173
def path_to_url
      prefix = Jammit.asset_roots.map{ |path| Regexp.escape(path) }.uniq.join("|")
      @path_to_url ||= /\A(#{prefix})(\/?#{Regexp.escape(Jammit.public_root.sub(/#{prefix}/, ''))})?/
    end
542015
def _build_url(self):
        """"""
        self.connection["upload_url"] = (
            "%s/%s" % (self.connection["jss"].base_url, "dbfileupload"))
        self.connection["delete_url"] = (
            "%s/%s" % (self.connection["jss"].base_url,
                       "casperAdminSave.jxml"))
457558
private URL buildUrl(final String styleSheetPath, final boolean skipStylesFolder) {

        URL cssResource = null;

        final List<String> stylePaths = skipStylesFolder ? Collections.singletonList("") : ResourceParameters.STYLE_FOLDER.get();

        for (int i = 0; i < stylePaths.size() && cssResource == null; i++) {

            String stylePath = stylePaths.get(i);
            if (!stylePath.isEmpty()) {
                stylePath += Resources.PATH_SEP;
            }
            cssResource = Thread.currentThread().getContextClassLoader().getResource(stylePath + styleSheetPath);
        }

        if (cssResource == null) {
            LOGGER.error("Style Sheet : {} not found into base folder: {}", styleSheetPath, ResourceParameters.STYLE_FOLDER.get());
        }
        return cssResource;
    }