(self, value_url, source_url, mark)
return url
Transform relative URLs into absolute URLs if possible.

        If the value_url is already absolute, or we don't know the
        source_url, then return the existing value. If the value_url is
        relative, and we know the source_url, then try to rewrite it.
Transform relative URLs into absolute URLs if possible.
Transform relative URLs into absolute URLs if possible .
def cleanup_url(self, value_url, source_url, mark):
        """
        Transform relative URLs into absolute URLs if possible.

        If the value_url is already absolute, or we don't know the
        source_url, then return the existing value. If the value_url is
        relative, and we know the source_url, then try to rewrite it.
        """
        value = urllib.parse.urlparse(value_url)
        if value.netloc or not source_url:
            url = value_url
        else:
            url = urllib.parse.urljoin(source_url, value_url)
        if url.startswith('//'):
            url = 'http:' + url # MissingSchema fix
        if mark:
            url = url + mark
        return url
def cleanup_url ( self , value_url , source_url , mark ) : value = urllib . parse . urlparse ( value_url ) if value . netloc or not source_url : url = value_url else : url = urllib . parse . urljoin ( source_url , value_url ) if url . startswith ( '//' ) : url = 'http:' + url # MissingSchema fix if mark : url = url + mark return url