(base, url)
return joined
Parameters:
      base: Base URL to join with <url>.
      url: Relative or absolute URL to join with <base>.

    Returns: The resultant URL from joining <base> and <url>.
Parameters:
      base: Base URL to join with <url>.
      url: Relative or absolute URL to join with <base>.
Parameters : base : Base URL to join with <url > . url : Relative or absolute URL to join with <base > .
def urljoin(base, url):
    """
    Parameters:
      base: Base URL to join with <url>.
      url: Relative or absolute URL to join with <base>.

    Returns: The resultant URL from joining <base> and <url>.
    """
    base_scheme = get_scheme(base) if has_netloc(base) else None
    url_scheme = get_scheme(url) if has_netloc(url) else None

    if base_scheme is not None:
        # For consistent URL joining, switch the base URL's scheme to
        # 'http'. urllib.parse.urljoin() behaves differently depending on the
        # scheme. E.g.
        #
        #   >>> urllib.parse.urljoin('http://google.com/', 'hi')
        #   'http://google.com/hi'
        #
        # vs
        #
        #   >>> urllib.parse.urljoin('asdf://google.com/', 'hi')
        #   'hi'
        root = set_scheme(base, 'http')
    else:
        root = base

    joined = urllib.parse.urljoin(root, url)

    new_scheme = url_scheme if url_scheme is not None else base_scheme
    if new_scheme is not None and has_netloc(joined):
        joined = set_scheme(joined, new_scheme)

    return joined
def urljoin ( base , url ) : base_scheme = get_scheme ( base ) if has_netloc ( base ) else None url_scheme = get_scheme ( url ) if has_netloc ( url ) else None if base_scheme is not None : # For consistent URL joining, switch the base URL's scheme to # 'http'. urllib.parse.urljoin() behaves differently depending on the # scheme. E.g. # #   >>> urllib.parse.urljoin('http://google.com/', 'hi') #   'http://google.com/hi' # # vs # #   >>> urllib.parse.urljoin('asdf://google.com/', 'hi') #   'hi' root = set_scheme ( base , 'http' ) else : root = base joined = urllib . parse . urljoin ( root , url ) new_scheme = url_scheme if url_scheme is not None else base_scheme if new_scheme is not None and has_netloc ( joined ) : joined = set_scheme ( joined , new_scheme ) return joined