

def add_test_set(db_conn, users_table=None, units_table=None, responses_table=None, sets_table=None):
    "\n    Add doesn't require anything.\n    Multiply requires add.\n    Subtract requires add.\n    Divide requires multiply.\n\n    Add is done,\n    Subtract needs review,\n    Multiply needs to be learned,\n    Divide needs to be diagnosed.\n    "
    if users_table:
        users_table.insert({
            'id': 'user',
        }).run(db_conn)
    if units_table:
        units_table.insert([{
            'entity_id': 'add',
            'status': 'accepted',
            'created': r.now(),
        }, {
            'entity_id': 'subtract',
            'require_ids': ['add'],
            'status': 'accepted',
            'created': r.now(),
        }, {
            'entity_id': 'multiply',
            'require_ids': ['add'],
            'status': 'accepted',
            'created': r.now(),
        }, {
            'entity_id': 'divide',
            'require_ids': ['multiply', 'subtract'],
            'status': 'accepted',
            'created': r.now(),
        }]).run(db_conn)
    if responses_table:
        responses_table.insert([{
            'user_id': 'user',
            'unit_id': 'add',
            'learned': 0.99,
            'created': r.now(),
        }, {
            'user_id': 'user',
            'unit_id': 'multiply',
            'learned': 0.0,
            'created': r.now(),
        }, {
            'user_id': 'user',
            'unit_id': 'subtract',
            'learned': 0.99,
            'created': r.time(2004, 11, 3, 'Z'),
        }]).run(db_conn)
    if sets_table:
        sets_table.insert({
            'entity_id': 'set',
            'status': 'accepted',
            'members': [{
                'id': 'add',
                'kind': 'unit',
            }, {
                'id': 'subtract',
                'kind': 'unit',
            }, {
                'id': 'multiply',
                'kind': 'unit',
            }, {
                'id': 'divide',
                'kind': 'unit',
            }],
        }).run(db_conn)

dataset/ETHPy150Open heiskr/sagefy/server/test/test_modules_sequencer_traversal.py add_test_set/original