@gen.engine
def SetupAndDispatch(callback):
 EmailManager.SetInstance(SendGridEmailManager())
 ThrottleUsage()
 client = db_client.DBClient.Instance()
 (yield gen.Task(Dispatch, client))
 callback()

@ gen . engine def SetupAndDispatch ( callback ) : EmailManager . SetInstance ( SendGridEmailManager ( ) ) ThrottleUsage ( ) client = db_client . DBClient . Instance ( ) ( yield gen . Task ( Dispatch , client ) ) callback ( )
sets the environment and dispatches according to command-line options .