<s> import os , sys <EOL> sys . path . append ( "<STR_LIT:..>" ) <EOL> from riemann . twisted import txRiemannClient <EOL> from twisted . internet import reactor , protocol , defer <EOL> class Echo ( protocol . Protocol ) : <EOL> rc = txRiemannClient ( ) <EOL> @ defer . inlineCallback <EOL> def dataReceived ( self , data ) : <EOL> self . transport . write ( data ) <EOL> yield rc . send ( { '<STR_LIT:host>' : '<STR_LIT:127.0.0.1>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:state>' : '<STR_LIT>' , '<STR_LIT>' : <NUM_LIT:1> } ) <EOL> def main ( ) : <EOL> factory = protocol . ServerFactory ( ) <EOL> factory . protocol = Echo <EOL> reactor . listenTCP ( <NUM_LIT> , factory ) <EOL> reactor . run ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
