def auto_out(apps):
    routes = []
    for domain, path in [x.strip().split() for x in apps.split('\n') if x.strip() and not x.strip().startswith('#')]:
        if not path.startswith('/'):
            path = '/' + path
        if path.endswith('/'):
            path = path[:-1]
        app = path.split('/')[1]
        routes += [
            (app % '/%s/static/$anything', '/static/$anything'),
            ('/%s/appadmin/$anything' % app, '/appadmin/$anything'),
            ('%s/$anything' % path, '/$anything'),
        ]
    return routes
dataset/ETHPy150Open uwdata/termite-data-server/web2py/scripts/autoroutes.py/auto_out/swapped operands of `%`