<s> from twisted . internet . defer import Deferred <EOL> def got_poem ( res ) : <EOL> print '<STR_LIT>' <EOL> print res <EOL> def poem_failed ( err ) : <EOL> print err . __class__ <EOL> print err <EOL> print '<STR_LIT>' <EOL> d = Deferred ( ) <EOL> d . addCallbacks ( got_poem , poem_failed ) <EOL> d . errback ( Exception ( '<STR_LIT>' ) ) </s>
