<s> """<STR_LIT>""" <EOL> from twisted . web import xmlrpc <EOL> from twisted . internet import defer <EOL> import xmlrpclib <EOL> class Echoer ( xmlrpc . XMLRPC ) : <EOL> """<STR_LIT>""" <EOL> def xmlrpc_echo ( self , * args ) : <EOL> """<STR_LIT>""" <EOL> return args <EOL> def xmlrpc_hello ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' <EOL> def xmlrpc_defer ( self ) : <EOL> """<STR_LIT>""" <EOL> return defer . succeed ( "<STR_LIT:hello>" ) <EOL> def xmlrpc_defer_fail ( self ) : <EOL> """<STR_LIT>""" <EOL> return defer . fail ( <NUM_LIT:12> ) <EOL> def xmlrpc_fail ( self ) : <EOL> """<STR_LIT>""" <EOL> return xmlrpclib . Fault ( <NUM_LIT:7> , "<STR_LIT>" ) <EOL> def main ( ) : <EOL> from twisted . internet import reactor <EOL> from twisted . web import server <EOL> r = Echoer ( ) <EOL> reactor . listenTCP ( <NUM_LIT> , server . Site ( r ) ) <EOL> reactor . run ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
