Resolves a URL given a path
@param {string} url - URL to resolve
@param {string} path - Path to append to base URL
@return {string} resolvedUrl - A valid URL
8402
function resolveURL(url, path) {
  if (typeof url !== 'string' || typeof path !== 'string') {
    return new Error('url-and-path-required');
  }

  /* Remove leading and duplicate slashes */
  url = url.replace(/\/{2,}/g, '/').replace(/^\//, '').replace(':/','://');

  let parsedUrl = urlModule.parse(url);
  if (protocols.indexOf(parsedUrl.protocol) < 0 || !parsedUrl.host) {
    return new Error('invalid-url');
  }

  let resolvedUrl = urlModule.resolve(parsedUrl.href, path);
  return resolvedUrl;
}
1024943
def resolve(context, path)
      context.resolve(path, content_type: 'text/css')
    rescue ::Sprockets::FileNotFound
      begin
        context.resolve(path + '/index', content_type: 'text/css')
      rescue
        nil
      end
    end
573506
function url(path) {
        if (path) {
            if (_.startsWith(path, "/")) {
                if (!_urlPrefix) {
                    // lets discover the base url via the base html element
                    _urlPrefix = $('base').attr('href') || "";
                    if (_.endsWith(_urlPrefix, '/')) {
                        _urlPrefix = _urlPrefix.substring(0, _urlPrefix.length - 1);
                    }
                }
                if (_urlPrefix) {
                    return _urlPrefix + path;
                }
            }
        }
        return path;
    }
512055
function url_for(path) {
  path = urljoin([agneta.root, path]);

  if (path[0] != '/') {
    path = '/' + path;
  }

  return path;
}
1020799
function parseUrl (url) {
  if (typeof URL === 'function') {
    // Use the new WHATWG URL API
    return new URL(url);
  }
  else {
    // Use the legacy url API
    var parsed = legacyURL.parse(url);

    // Replace nulls with default values, for compatibility with the WHATWG URL API
    parsed.pathname = parsed.pathname || '/';
    parsed.search = parsed.search || '';
  }
}
47934
function resolve(path, config) {
    var original = path;

    if (/^([0-9a-z_$]+(\.[0-9a-z_$]+)*)$/gi.test(path))
        path = path.replace(/\./gi, '/') + '.js';

    var libs = config.getLibs();
    var appRoot = config.getBasePath();
    var appCodeDir = config.getAppDir();

    for(var prefix in libs) if (libs.hasOwnProperty(prefix)) {
        if (path.substr(0, prefix.length) == prefix) {
            path = libs[prefix] + path.substring(prefix.length);
            break;
        }
    }

    path = path.replace(/^~\//gi, appRoot);
    path = path.replace(/^\.\//gi, appCodeDir);

    if (!path.match(/^\//i) && !path.match(/^\w:\\/))
        path = appCodeDir + path;

    path = path.replace(/\/\//gi, '/');

    return path;
}
1209745
function getUrlParams(path) {
    if (!path) {
      return {};
    }
    var bits = path.split('?');
    var querystring = bits.length > 1 ? bits[1] : '';
    return toObject(querystring);
  }
457922
function(url, base) {
			if (!url || url.indexOf('://') !== -1) { return url; }

			var anchor = document.createElement('a');
			anchor.href = (base || location.href);

			var protocol	= anchor.protocol + '//',
				host		= anchor.host,
				path		= anchor.pathname,
				parts		= filter(path.split('/'), function(part) { return part !== ''; });

			each(url.replace(/\?.*/, '').split('/'), function(part, index) {
				switch(part) {
					case '..':
						if (!parts.length) {
							throw new Error('Path outside of root: ' + url);
						}
						parts.length--;
						break;
					case '.':	break;
					default:	parts.push(part); break
				}
			});
			return protocol + host + '/' + parts.join('/');
		}
348009
function resolveFile(success, fail, request, options) {
    var path = request.substring(7);
    resolve(success, fail, path, window.PERSISTENT, UNSANDBOXED, options);
}
300917
def resolve_url(url, desktop_user_agent=None, mobile_user_agent=None):
    
    if not desktop_user_agent:
        desktop_user_agent = DESKTOP_USER_AGENT
    if not mobile_user_agent:
        mobile_user_agent = MOBILE_USER_AGENT

    input_urls = set()

    parsed = urlparse(url_with_protocol(url))
    netloc = parsed.netloc

    if netloc.startswith('www.'):
        netloc = netloc[4:]

    input_urls.add('http://%s%s' % (netloc, parsed.path if parsed.path else '/'))
    input_urls.add('http://www.%s%s' % (netloc, parsed.path if parsed.path else '/'))

    resolved_urls = set()

    for input_url in input_urls:
        desktop_request = requests.get(input_url, headers={'User-Agent': desktop_user_agent})
        resolved_urls.add(desktop_request.url)
        mobile_request = requests.get(input_url, headers={'User-Agent': mobile_user_agent})
        resolved_urls.add(mobile_request.url)

    return list(resolved_urls)
74842
def _url(self, path: str) -> str:
        
        url = "{}/{}".format(self.__base_url, path)
        logger.debug("transformed path [%s] into url: %s", path, url)
        return url
608621
function buildUrl(path, search) {
    return Object.keys(search).length ? path + '?' + qs.stringify(search) : path;
  }
1289192
def resolved_path(path, base=None):
    
    if not path or path.startswith(SYMBOLIC_TMP):
        return path

    path = os.path.expanduser(path)
    if base and not os.path.isabs(path):
        return os.path.join(resolved_path(base), path)

    return os.path.abspath(path)
740173
function resolveAddress(object, path) {
                var parts = path.split('.');

                if (object === undefined) {
                    return;
                }

                return parts.length < 2 ? object[parts[0]] : resolveAddress(object[parts[0]], parts.slice(1).join('.'));
            }
1125041
def add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper):
    
    Loader.add_path_resolver(tag, path, kind)
    Dumper.add_path_resolver(tag, path, kind)
890753
function resolvePathFor(options, src) {
  if (Array.isArray(src)) {
    src.forEach(dir => resolvePathFor(options, dir));
  } else {
    const relativePath = get(options, src);
    if (Array.isArray(relativePath)) {
      set(options, src, relativePath.map(n => getAbsPath(n)));
    } else {
      const _absPath = getAbsPath(relativePath);
      relativePath !== _absPath && set(options, src, _absPath);
    }
  }
}
366592
function resolveURL(url) {
		return new URI(url).absoluteTo(new URI(document.baseURI).search("")).toString();
	}