Build the url for a cable ratings page
767110
def _build_url(self, shorten=True):
        """"""
        self.url = URL_FORMAT.format(*self._get_url_params(shorten=shorten))
328504
def display_url(target):
    """"""

    prefix = u"http://" if not target.startswith("http") else u""
    target = prefix + target
    display(HTML(u'<a href="{t}" target=_blank>{t}</a>'.format(t=target)))
1269681
def _url_to_props(self, url):
        
        props = (url[len(self.base_url):] if url.startswith(self.base_url) else
                 url[len(self.base_http_url):]).split('/')
        if props[0] == 'products':
            tile_props = props[:5]
            props = props[5:]
            if props[0] == 'datastrip':
                props[1] = '*'
        else:
            tile_props = props[:8]
            props = props[8:]
        return '/'.join(tile_props), '/'.join(props)
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)
360560
def stream_url(self):
        """"""
        rtsp_url = RTSP_URL.format(
            host=self.config.host, video=self.video_query,
            audio=self.audio_query, event=self.event_query)
        _LOGGER.debug(rtsp_url)
        return rtsp_url
113493
def _build_url(url, _params):
    """"""

    # Support for unicode domain names and paths.
    scheme, netloc, path, params, query, fragment = urlparse(url)
    netloc = netloc.encode('idna').decode('utf-8')
    if not path:
        path = '/'

    if six.PY2:
        if isinstance(scheme, six.text_type):
            scheme = scheme.encode('utf-8')
        if isinstance(netloc, six.text_type):
            netloc = netloc.encode('utf-8')
        if isinstance(path, six.text_type):
            path = path.encode('utf-8')
        if isinstance(params, six.text_type):
            params = params.encode('utf-8')
        if isinstance(query, six.text_type):
            query = query.encode('utf-8')
        if isinstance(fragment, six.text_type):
            fragment = fragment.encode('utf-8')

    enc_params = _encode_params(_params)
    if enc_params:
        if query:
            query = '%s&%s' % (query, enc_params)
        else:
            query = enc_params
    url = (urlunparse([scheme, netloc, path, params, query, fragment]))
    return url
354208
def _compute_page_url(self):
        """"""
        for page in self:
            base_url = self.env['ir.config_parameter'].sudo().get_param(
                'web.base.url',
                default='http://localhost:8069'
            )

            page.page_url = (
                '{}/web#db={}&id={}&view_type=form&'
                'model=document.page.history').format(
                    base_url,
                    self.env.cr.dbname,
                    page.id
                )
880460
def _build_url(self, resource, **kwargs):
        # type: (str, **str) -> str
        """"""
        return urljoin(self.api_root, API_PATH[resource].format(**kwargs))
1063097
def build_api_url(host=REMOTES['default']['ip'],
                  port=REMOTES['default']['port'],
                  path=REMOTES['default']['path'],
                  username=None,
                  password=None,
                  ssl=False):
    """"""
    credentials = make_http_credentials(username, password)
    scheme = 'http'
    if not path:
        path = ''
    if path and not path.startswith('/'):
        path = "/%s" % path
    if ssl:
        scheme += 's'
    return "%s://%s%s:%i%s" % (scheme, credentials, host, port, path)
691520
def score_url(self, url):
        
        t = urlparse(url)
        return (t.scheme != 'https', 'pypi.python.org' in t.netloc,
                posixpath.basename(t.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)
99725
protected function buildUrl() {
		$this->url = $this->baseUrl . '?' . http_build_query(['secret' => $this->secretKey, 'response' => $this->response]);
	}
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
50100
def link(self, *args, **urlargs):
        ''''''
        if len(args) > 1:
            raise ValueError
        url = self.route.url(**urlargs)
        if len(args) == 1:
            text = args[0]
        else:
            text = url
        return Html('a', text, href=url)
908535
def page_url(self) -> str:
        """"""
        url = self.attributes['canonicalurl']
        assert isinstance(url, str)
        return url
759999
def makeMNBaseURL(url):
    """"""
    o = urllib.parse.urlparse(url, scheme=d1_common.const.DEFAULT_MN_PROTOCOL)
    if o.netloc and o.path:
        netloc = o.netloc
        path = o.path
    elif o.netloc:
        netloc = o.netloc
        path = d1_common.const.DEFAULT_MN_PATH
    elif o.path:
        s = o.path.split('/', 1)
        netloc = s[0]
        if len(s) == 1:
            path = d1_common.const.DEFAULT_MN_PATH
        else:
            path = s[1]
    else:
        netloc = d1_common.const.DEFAULT_MN_HOST
        path = d1_common.const.DEFAULT_MN_PATH
    return urllib.parse.urlunparse(
        (o.scheme, netloc, path, o.params, o.query, o.fragment)
    )
1332197
def score_url(self, url):
        
        t = urlparse(url)
        basename = posixpath.basename(t.path)
        compatible = True
        is_wheel = basename.endswith('.whl')
        is_downloadable = basename.endswith(self.downloadable_extensions)
        if is_wheel:
            compatible = is_compatible(Wheel(basename), self.wheel_tags)
        return (t.scheme == 'https', 'pypi.python.org' in t.netloc,
                is_downloadable, is_wheel, compatible, basename)