<s> from nodeset . core import utils <EOL> from core import SimpleMessage , SimpleNode <EOL> def do_publish ( node , event_name , ** kw ) : <EOL> print "<STR_LIT>" % ( kw , event_name ) <EOL> node . publish ( event_name , SimpleMessage , ** kw ) <EOL> def _err ( failure ) : <EOL> print failure <EOL> from twisted . internet import reactor <EOL> utils . setDefaultOptions ( ) <EOL> node = SimpleNode ( name = '<STR_LIT>' , port = <NUM_LIT> ) <EOL> node . start ( ) . addCallback ( do_publish , '<STR_LIT>' , field1 = '<STR_LIT>' ) . addErrback ( _err ) <EOL> node . startService ( ) <EOL> reactor . run ( ) </s>
