<s> import logging <EOL> from invoke import task <EOL> import IPython <EOL> from okcupyd import db <EOL> from okcupyd import util <EOL> from okcupyd . db import mailbox , model <EOL> from okcupyd . user import User <EOL> log = logging . getLogger ( __name__ ) <EOL> @ task ( default = True ) <EOL> def session ( ) : <EOL> with db . txn ( ) as session : <EOL> IPython . embed ( ) <EOL> @ task <EOL> def reset ( ) : <EOL> util . enable_logger ( __name__ ) <EOL> log . info ( db . Base . metadata . bind ) <EOL> db . Base . metadata . drop_all ( ) <EOL> db . Base . metadata . create_all ( ) <EOL> @ task <EOL> def sync ( ) : <EOL> user = User ( ) <EOL> mailbox . Sync ( user ) . all ( ) <EOL> log . info ( model . Message . query ( model . User . okc_id == user . profile . id ) ) <EOL> @ task <EOL> def make ( ) : <EOL> user = User ( ) <EOL> user_model = model . User . from_profile ( user . profile ) <EOL> user_model . upsert_model ( id_key = '<STR_LIT>' ) <EOL> okcupyd_user = model . OKCupydUser ( user_id = user_model . id ) <EOL> okcupyd_user . upsert_model ( id_key = '<STR_LIT>' ) <EOL> return okcupyd_user </s>
