# Path: apps/Tests/tests/test_api.py
# def get_alg(butler):
#     assert butler.algorithms['alg_key_1'] == butler.algorithms.get(key='alg_key_1') == 'alg_value_1'
#     assert butler.algorithms['alg_key_2'] == butler.algorithms.get(key='alg_key_2') == 'alg_value_2'
#     assert butler.algorithms.memory['alg_key_mem_1'] == butler.algorithms.memory.get(key='alg_key_mem_1') == 'alg_value_mem_1'
#     assert butler.algorithms.memory['alg_key_mem_2'] == butler.algorithms.memory.get(key='alg_key_mem_2') == 'alg_value_mem_2'
# 
# def get_exp(butler):
#     assert butler.experiment['exp_key_1'] == butler.experiment.get(key='exp_key_1') == 'exp_value_1'
#     assert butler.experiment['exp_key_2'] == butler.experiment.get(key='exp_key_2') == 'exp_value_2'
#     assert butler.experiment.memory['exp_key_mem_1'] == butler.experiment.memory.get(key='exp_key_mem_1') == 'exp_value_mem_1'
#     assert butler.experiment.memory['exp_key_mem_2'] == butler.experiment.memory.get(key='exp_key_mem_2') == 'exp_value_mem_2'
# 
# def set_and_get_exp(butler):
#     butler.experiment['exp_key_1'] = 'exp_value_1'
#     butler.experiment.set(key='exp_key_2', value='exp_value_2')
#     butler.experiment.memory['exp_key_mem_1'] = 'exp_value_mem_1'
#     butler.experiment.memory.set(key='exp_key_mem_2', value='exp_value_mem_2')
#     get_exp(butler)


import next.apps.SimpleTargetManager
from apps.Tests.tests.test_api import get_alg, get_exp, set_and_get_exp


class MyApp:
    def __init__(self,db):
        self.app_id = 'Tests'
        self.TargetManager = next.apps.SimpleTargetManager.SimpleTargetManager(db)

    def initExp(self, butler, init_algs, args):
        set_and_get_exp(butler)
        init_algs({})
        return args

    def getQuery(self, butler, alg, args):
        get_exp(butler)
        assert alg() == "return_get_query"
        return {}

    def processAnswer(self, butler, alg, args):

# Path: apps/Tests/tests/test_api.py
# def get_alg(butler):
#     assert butler.algorithms['alg_key_1'] == butler.algorithms.get(key='alg_key_1') == 'alg_value_1'
#     assert butler.algorithms['alg_key_2'] == butler.algorithms.get(key='alg_key_2') == 'alg_value_2'
#     assert butler.algorithms.memory['alg_key_mem_1'] == butler.algorithms.memory.get(key='alg_key_mem_1') == 'alg_value_mem_1'
#     assert butler.algorithms.memory['alg_key_mem_2'] == butler.algorithms.memory.get(key='alg_key_mem_2') == 'alg_value_mem_2'
# 
# def get_exp(butler):
#     assert butler.experiment['exp_key_1'] == butler.experiment.get(key='exp_key_1') == 'exp_value_1'
#     assert butler.experiment['exp_key_2'] == butler.experiment.get(key='exp_key_2') == 'exp_value_2'
#     assert butler.experiment.memory['exp_key_mem_1'] == butler.experiment.memory.get(key='exp_key_mem_1') == 'exp_value_mem_1'
#     assert butler.experiment.memory['exp_key_mem_2'] == butler.experiment.memory.get(key='exp_key_mem_2') == 'exp_value_mem_2'
# 
# def set_and_get_exp(butler):
#     butler.experiment['exp_key_1'] = 'exp_value_1'
#     butler.experiment.set(key='exp_key_2', value='exp_value_2')
#     butler.experiment.memory['exp_key_mem_1'] = 'exp_value_mem_1'
#     butler.experiment.memory.set(key='exp_key_mem_2', value='exp_value_mem_2')
#     get_exp(butler)


# Path: apps/Tests/myApp.py
import next.apps.SimpleTargetManager
from apps.Tests.tests.test_api import get_alg, get_exp, set_and_get_exp



class MyApp:
    def __init__(self,db):
        self.app_id = 'Tests'
        self.TargetManager = next.apps.SimpleTargetManager.SimpleTargetManager(db)

    def initExp(self, butler, init_algs, args):
        set_and_get_exp(butler)
        init_algs({})
        return args

    def getQuery(self, butler, alg, args):
        get_exp(butler)
        assert alg() == "return_get_query"
        return {}

    def processAnswer(self, butler, alg, args):

        get_exp(butler)