Returns a URL instance
184253
function(path) {

		// If the path is empty
		if (!path) {
			return window.location;
		}

		// Chrome and FireFox support new URL() to extract URL objects
		else if (window.URL && URL instanceof Function && URL.length !== 0) {
			return new URL(path, window.location);
		}

		// Ugly shim, it works!
		else {
			var a = document.createElement('a');
			a.href = path;
			return a.cloneNode(false);
		}
	}
314710
def get_url(url, catch_exception=False):
    
    return _get_url(url, catch_exception, urlopen=urllib2.urlopen)
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)
872325
def get_url(self, cmd, **args):
        """"""
        return self.http.base_url + self._mkurl(cmd, *args)
359792
def to_url(self, url=None, replace=False, **kwargs):
        ''''''
        params = copy.deepcopy(self.filter_values)
        if self._query:
            params['q'] = self._query
        if self.page_size != DEFAULT_PAGE_SIZE:
            params['page_size'] = self.page_size
        if kwargs:
            for key, value in kwargs.items():
                if not replace and key in params:
                    if not isinstance(params[key], (list, tuple)):
                        params[key] = [params[key], value]
                    else:
                        params[key].append(value)
                else:
                    params[key] = value
        else:
            params['page'] = self.page
        href = Href(url or request.base_url)
        return href(params)
112067
def get_download_url(self, instance, default=None):
        
        download = default
        # calculate the download url
        download = "{url}/@@download/{fieldname}/{filename}".format(
            url=api.get_url(instance),
            fieldname=self.get_field_name(),
            filename=self.get_filename(instance),
        )
        return download
118658
def url(self):
        
        with switch_window(self._browser, self.name):
            return self._browser.url
106471
def url(url: str, method: str):
    """"""
    try:
        url_rule, params = (current_app.url_map.bind('localhost')
                            .match(url, method=method, return_rule=True))
    except (NotFound, MethodNotAllowed)\
            as e:
        click.secho(str(e), fg='white', bg='red')
    else:
        headings = ('Method(s)', 'Rule', 'Params', 'Endpoint', 'View', 'Options')
        print_table(headings,
                    [(_get_http_methods(url_rule),
                      url_rule.rule if url_rule.strict_slashes
                                    else url_rule.rule + '[/]',
                      _format_dict(params),
                      url_rule.endpoint,
                      _get_rule_view(url_rule),
                      _format_rule_options(url_rule))],
                    ['<' if i > 0 else '>' for i, col in enumerate(headings)],
                    primary_column_idx=1)
464532
def get_instance(uri):
    """"""
    global _instances
    try:
        instance = _instances[uri]
    except KeyError:
        instance = Page(
            uri,
            client.get_instance()
        )
        _instances[uri] = instance

    return instance
1275658
def url(style = :original, *args)
      if style.to_sym == :original
        original_url(*args)
      else
        named_url(style, *args)
      end
    end
734126
function computeURL() {
          var url = $(input).data("settings").url;
          if(typeof $(input).data("settings").url == 'function') {
              url = $(input).data("settings").url.call($(input).data("settings"));
          }
          return url;
      }
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
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
90213
def get_url(width, height, color=True):
    
    d = dict(width=width, height=height)
    return URL % d
783793
def url(self):
        ''''''
        return URL.from_url(self.request.url, show_host=self.show_host)
562451
def url(self):
        
        path = None
        nodes = self.parents()
        while not nodes.empty():
            path = urljoin(path, nodes.get().path())
        return path
1042180
def get_url(self, resource, params=None):
        

        # replace placeholders

        pattern = r'\{(.+?)\}'

        resource = re.sub(pattern, lambda t: str(params.get(t.group(1), '')), resource)

        # build url

        parts = (self.endpoint, '/api/', resource)
        return '/'.join(map(lambda x: str(x).strip('/'), parts))