def url_out(request, environ, application, controller, function,
            args, other, scheme, host, port):
    "assemble and rewrite outgoing URL"
    if routers:
        acf = map_url_out(request, environ, application, controller,
                          function, args, other, scheme, host, port)
        url = '%s%s' % (acf, other)
    else:
        url = '/%s/%s/%s%s' % (application, controller, function, other)
        url = regex_filter_out(url, environ)
    #
    #  fill in scheme and host if absolute URL is requested
    #  scheme can be a string, eg 'http', 'https', 'ws', 'wss'
    #
    if host is True or (host is None and (scheme or port is not None)):
        host = request.env.http_host
    if not scheme or scheme is True:
        scheme = request.env.get('wsgi_url_scheme', 'http').lower() \
            if request else 'http'
    if host:
        host_port = host if not port else host.split(':', 1)[0] + port % ':%s'
        url = '%s://%s%s' % (scheme, host_port, url)
    return url
dataset/ETHPy150Open uwdata/termite-visualizations/web2py/gluon/rewrite.py/url_out/swapped operands of `%`