Return the show feed URL with different protocol.
184920
def show_url(context, **kwargs):
    """"""
    if len(kwargs) != 2:
        raise TemplateSyntaxError(_('"show_url" tag takes exactly two keyword arguments.'))
    request = context['request']
    current_site = get_current_site(request)
    url = add_domain(current_site.domain, kwargs['url'])
    return re.sub(r'https?:\/\/', '%s://' % kwargs['protocol'], url)
519293
def receiver(url, **kwargs):
    
    res = url_to_resources(url)
    fnc = res["receiver"]
    return fnc(res.get("url"), **kwargs)
1032156
def get_url(request):
    
    protocol = request.headers.get('X-Forwarded-Proto') or request.headers.get('X-Forwarded-Protocol')
    if protocol is None and request.headers.get('X-Forwarded-Ssl') == 'on':
        protocol = 'https'
    if protocol is None:
        return request.url
    url = list(urlparse(request.url))
    url[0] = protocol
    return urlunparse(url)
644756
def url(self, node):
        
        a_node = node.findParent('a')
        if not a_node:
            return None

        if self.link_callback is None:
            return a_node.get('href')
        else:
            return self.link_callback(a_node.get('href'))
816177
def _url(self, url):
        

        protocol = 'https' if self.https else 'http'
        return '{0}://{1}/spaces/{2}{3}'.format(
            protocol,
            self.api_url,
            self.space_id,
            url
        )
1341701
def create_external_feed_courses(self, url, course_id, header_match=None, verbosity=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # REQUIRED - url
        """The url to the external rss or atom feed"""
        data["url"] = url

        # OPTIONAL - header_match
        """If given, only feed entries that contain this string in their title will be imported"""
        if header_match is not None:
            data["header_match"] = header_match

        # OPTIONAL - verbosity
        """Defaults to "full""""
        if verbosity is not None:
            self._validate_enum(verbosity, ["full", "truncate", "link_only"])
            data["verbosity"] = verbosity

        self.logger.debug("POST /api/v1/courses/{course_id}/external_feeds with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/courses/{course_id}/external_feeds".format(**path), data=data, params=params, single_item=True)
1328897
async def get_feed(config, url):
    

    LOGGER.debug("++WAIT: cache get feed %s", url)
    previous = config.cache.get(
        'feed', url, schema_version=SCHEMA_VERSION) if config.cache else None
    LOGGER.debug("++DONE: cache get feed %s", url)

    headers = previous.caching if previous else None

    LOGGER.debug("++WAIT: request get %s", url)
    request = await utils.retry_get(config, url, headers=headers)
    LOGGER.debug("++DONE: request get %s", url)
    if not request or not request.success:
        LOGGER.error("Could not get feed %s: %d",
                     url,
                     request.status if request else -1)
        return None, previous, False

    if request.cached:
        LOGGER.debug("%s: Reusing cached version", url)
        return previous, previous, False

    current = Feed(request)

    if config.cache:
        LOGGER.debug("%s: Saving to cache", url)
        LOGGER.debug("++WAIT: cache set feed %s", url)
        config.cache.set('feed', url, current)
        LOGGER.debug("++DONE: cache set feed %s", url)

    LOGGER.debug("%s: Returning new content", url)
    return current, previous, (not previous
                               or current.digest != previous.digest
                               or current.status != previous.status)
264502
def get_context(self, url, expiration):
        
        self._feed = self.get(url, expiration)
        
        return {
            self.feed_context_name: self.format_feed_content(self._feed),
        }
452611
def _get_url(self, url):
        """"""
        if self.base_url and not url.startswith(('http://', 'https://')):
            return urljoin(self.base_url, url)
        return url
373976
def url(self, version=None, **kwargs):
        """"""
        for url in self.urls(version):
            if [key for key in kwargs.keys() if not '{' + key + '}' in url]:
                continue

            return url.format(**kwargs)

        raise KeyError('URL that takes all provided parameters not found')
474146
def found_url(self, url, name, base):
        """"""
        assert isinstance(url, unicode) or url is None, repr(url)
        self.callback(url, line=self.parser.last_lineno(),
                      column=self.parser.last_column(), name=name, base=base)
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
131681
def link_tag(protocol, base_url, view)
      view.tag :link, :rel => 'alternate', :href => href(protocol, base_url), :id => id, :media => media_query
    end
1260700
def url(self):
        """"""
        return reverse('archives:thread_view',
                       args=[self.mailinglist.name,
                             self.thread.subject_token])
626668
def extract_feed(
    inpath: str, outpath: str, view: View, config: nx.DiGraph = None
) -> str:
    """"""
    config = default_config() if config is None else config
    config = remove_node_attributes(config, "converters")
    feed = load_feed(inpath, view, config)
    return write_feed_dangerously(feed, outpath)
223910
def get_feeds_url(blog_page, root_page):
    
    if root_page == blog_page:
        return reverse('blog_page_feed')
    else:
        blog_path = strip_prefix_and_ending_slash(blog_page.specific.last_url_part)
        return reverse('blog_page_feed_slug', kwargs={'blog_path': blog_path})
983551
def url(self) -> str:
        """"""
        return urlunparse(
            ParseResult(
                self.scheme, self.host, self.path, '', self.query_string.decode('ascii'), '',
            ),
        )