<s> import logging <EOL> from invoke import Collection , task <EOL> import IPython <EOL> from . import copy <EOL> from . import db as db_collection <EOL> from okcupyd import user , db , util <EOL> from okcupyd . db import model <EOL> log = logging . getLogger ( __name__ ) <EOL> model = model <EOL> ns = Collection ( ) <EOL> ns . add_collection ( copy ) <EOL> ns . add_collection ( db_collection ) <EOL> login = task ( util . get_credentials ) <EOL> ns . add_task ( login , '<STR_LIT>' ) <EOL> @ ns . add_task <EOL> @ task ( login , default = True ) <EOL> def interactive ( ) : <EOL> u = user . User ( ) <EOL> u = u <EOL> IPython . embed ( ) <EOL> @ ns . add_task <EOL> @ task ( aliases = '<STR_LIT:s>' ) <EOL> def session ( ) : <EOL> with db . txn ( ) as session : <EOL> session = session <EOL> IPython . embed ( ) <EOL> @ ns . add_task <EOL> @ task ( login ) <EOL> def enable_logger ( logger_name ) : <EOL> util . enable_logger ( logger_name ) <EOL> @ ns . add_task <EOL> @ task ( aliases = ( '<STR_LIT:c>' , ) ) <EOL> def credentials ( module_name ) : <EOL> util . update_settings_with_module ( module_name ) <EOL> @ ns . add_task <EOL> @ task ( aliases = ( '<STR_LIT>' , ) ) <EOL> def enable_all_loggers ( ) : <EOL> for logger_name in ( '<STR_LIT>' , '<STR_LIT>' , __name__ ) : <EOL> util . enable_logger ( logger_name ) <EOL> db . Session . kw [ '<STR_LIT>' ] . echo = True </s>
