def METHOD_NAME(base, uri, construct=True):
    p_uri = urlparse.urlparse(uri)
    # Return if there is nothing to join
    if not p_uri.path:
        return base
    scheme, netloc, path, params, query, fragment = urlparse.urlparse(base)
    # Switch to 'uri' parts
    _, _, _, params, query, fragment = p_uri
    path = join_path(path, p_uri.path)
    result = urlparse.ParseResult(scheme, netloc, path, params, query, fragment)
    if not construct:
        return result
    # Construct from parts
    return urlparse.urlunparse(result)