@WebApp.route('/delegate/')
@auth_required
def delegate(request):
    """Delegated authentication for deployed web apps."""
    back = request.args.get('back', request.referrer)
    login = request.context.github_login
    timestamp = datetime.datetime.utcnow()
    hostname = re.search(r'^https?://([^/]+)/', back).group(1)
    token = '{0:%Y%m%d%H%M%S}/{1}/{2}'.format(timestamp, login, hostname)
    secret = request.app.app.consistent_secret
    sig = hmac.new(secret, token, hashlib.sha256).hexdigest()
    back += ('&' if back in '?' else '?') + url_encode({
        'token': token,
        'sig': sig
    })
    return redirect(back)
dataset/ETHPy150Open crosspop/asuka/asuka/web.py/delegate/swapped operands of `in`