Example #1
0
def main():
    store = in_memory_store.InMemoryStore()
    user_id = 123
    is_perfectionist = True
    num_trial = 5
    problem_type = "anagram"

    exp = experiment.Experiment(user_id, is_perfectionist, num_trial,
                                problem_type, store)
    exp.run()

    print(store.dump())
Example #2
0
import api_calls
import constants
import in_memory_store as store
import notifications
import config

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)

requests_toolbelt.adapters.appengine.monkeypatch()
HTTP_REQUEST = google.auth.transport.requests.Request()

app = Flask(__name__)
flask_cors.CORS(app)
game_state = store.InMemoryStore()
api_mutex = threading.Lock()


def GetFirebase():
    """Get a Firebase connection, cached in the application context."""
    db = getattr(g, '_database', None)
    if db is None:
        auth = firebase.FirebaseAuthentication(config.FIREBASE_SECRET,
                                               config.FIREBASE_EMAIL,
                                               admin=True)
        db = firebase.FirebaseApplication(
            config.FIREBASE_CONFIG['databaseURL'], authentication=auth)
        g._database = db
    return db