@app.route('/foo/weblab/sessions/<session_id>/status')
def status(session_id):
    data = DATA.get(session_id, None)
    if data is not None:
        print "Did not poll in", datetime.datetime.now() - data['last_poll'], "seconds"
        print "User %s still has %s seconds" % (data['username'], (datetime.datetime.now() - data['max_date']).seconds)
        if (datetime.datetime.now() - data['last_poll']).seconds > 30:
            print "Kick out the user, please"
            return json.dumps({'should_finish' : -1})
            
    print "Ask in 10 seconds..."
    # 
    # If the user is considered expired here, we can return -1 instead of 10. 
    # The WebLab-Deusto scheduler will mark it as finished and will reassign
    # other user.
    # 
    return json.dumps({'should_finish' : 10})


#############################################################
# 
# WebLab-Deusto API:
# 
# This method is called to kick one user out. This may happen
# when an administrator defines so, or when the assigned time
# is over.
#
dataset/ETHPy150Open weblabdeusto/weblabdeusto/experiments/unmanaged/http/python/flask/sample.py/status/swapped operands of `-`