def build_url(endpoint, base_url=None, **kwargs):
    if endpoint[0] == '/':
        return endpoint, base_url

    try:
        url = url_for(endpoint, **kwargs)
    except __HOLE__:
        raise Exception("Endpoint does not exist")

    result = match("(http://[^/]+)(/.*)", url)
    if result:
        base_url, url = result.groups()

    return url, base_url
dataset/ETHPy150Open pytent/pytentd/tentd/tests/http.py/build_url