<s> """<STR_LIT>""" <EOL> from quarry . net . client import ClientFactory , ClientProtocol <EOL> from quarry . mojang . profile import Profile <EOL> class PingProtocol ( ClientProtocol ) : <EOL> def status_response ( self , data ) : <EOL> for k , v in sorted ( data . items ( ) ) : <EOL> if k != "<STR_LIT>" : <EOL> self . logger . info ( "<STR_LIT>" % ( k , v ) ) <EOL> self . factory . stop ( ) <EOL> class PingFactory ( ClientFactory ) : <EOL> protocol = PingProtocol <EOL> def main ( args ) : <EOL> import optparse <EOL> parser = optparse . OptionParser ( <EOL> usage = "<STR_LIT>" ) <EOL> ( options , args ) = parser . parse_args ( args ) <EOL> if len ( args ) != <NUM_LIT:2> : <EOL> return parser . print_usage ( ) <EOL> host , port = args <EOL> profile = Profile ( ) <EOL> profile . login_offline ( "<STR_LIT>" ) <EOL> factory = PingFactory ( ) <EOL> factory . profile = profile <EOL> factory . connect ( host , int ( port ) , "<STR_LIT:status>" ) <EOL> factory . run ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> import sys <EOL> main ( sys . argv [ <NUM_LIT:1> : ] ) </s>
