<s> from twisted . internet import defer <EOL> def callback ( res ) : <EOL> print '<STR_LIT>' , res <EOL> def errback ( err ) : <EOL> print '<STR_LIT>' , err <EOL> d = defer . Deferred ( ) <EOL> d . addCallbacks ( callback , errback ) <EOL> d . callback ( '<STR_LIT:result>' ) <EOL> d . cancel ( ) <EOL> print '<STR_LIT>' </s>
