def url(base_url, path, query_dict=None):
    url = urlparse.urljoin(base_url, path)
    scheme, netloc, path, query, fragment = urlparse.urlsplit(url)

    if query_dict:
        query = urllib.urlencode(query_dict)

    return urlparse.urlunsplit((scheme, netloc, path, query, fragment))
Given a base url, update with a specified path and query string.
dataset/ETHPy150Open dropbox/grouper/tests/url_util.py/url