@get('/s/cards/{card_id}/learn')  # TODO-3 merge with main GET route
def learn_card_route(request, card_id):

    db_conn = request['db_conn']

    current_user = get_current_user(request)
    if not current_user:
        return abort(401)

    card = get_card_by_kind(db_conn, card_id)
    if not card:
        return abort(404)

    # Make sure the current unit id matches the card
    context = current_user.get_learning_context()
    if context.get('unit', {}).get('entity_id') != card['unit_id']:
        return abort(400)

    next_ = {
        'method': 'POST',
        'path': '/s/cards/{card_id}/responses'
                .format(card_id=card['entity_id'])
    }
    current_user.set_learning_context(card=card.data, next=next_)

    return 200, {
        'card': card.deliver(access=''),
        'set': context.get('set'),
        'unit': context.get('unit'),
        'next': next_,
    }
Execute a number of steps while learning continuously.
dataset/ETHPy150Open heiskr/sagefy/server/routes/card.py/learn_card_route--crossover with--dataset/ETHPy150Open pybrain/pybrain/pybrain/rl/experiments/continuous.py/ContinuousExperiment.doInteractionsAndLearn