<s> import sys , json , httplib , urllib , base64 <EOL> if len ( sys . argv ) < <NUM_LIT:6> : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> server , port = sys . argv [ <NUM_LIT:1> ] . split ( "<STR_LIT::>" ) <EOL> username = sys . argv [ <NUM_LIT:2> ] <EOL> password = sys . argv [ <NUM_LIT:3> ] <EOL> vhost = sys . argv [ <NUM_LIT:4> ] <EOL> queue_name = sys . argv [ <NUM_LIT:5> ] <EOL> vhost = urllib . quote ( vhost , safe = '<STR_LIT>' ) <EOL> queue_name = urllib . quote ( queue_name , safe = '<STR_LIT>' ) <EOL> path = "<STR_LIT>" % ( vhost , queue_name ) <EOL> method = "<STR_LIT:GET>" <EOL> conn = httplib . HTTPConnection ( server , port ) <EOL> credentials = base64 . b64encode ( "<STR_LIT>" % ( username , password ) ) <EOL> headers = { "<STR_LIT:Content-Type>" : "<STR_LIT:application/json>" , <EOL> "<STR_LIT>" : "<STR_LIT>" + credentials } <EOL> conn . request ( method , path , "<STR_LIT>" , headers ) <EOL> response = conn . getresponse ( ) <EOL> if response . status > <NUM_LIT> : <EOL> print "<STR_LIT>" % ( response . status , <EOL> response . read ( ) ) <EOL> sys . exit ( <NUM_LIT:2> ) <EOL> resp_payload = json . loads ( response . read ( ) ) <EOL> print "<STR_LIT>" % urllib . unquote ( queue_name ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" + str ( resp_payload [ "<STR_LIT>" ] ) <EOL> print "<STR_LIT>" + str ( resp_payload [ "<STR_LIT>" ] ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" + str ( resp_payload [ "<STR_LIT>" ] ) <EOL> print "<STR_LIT>" + str ( resp_payload [ "<STR_LIT>" ] ) <EOL> print "<STR_LIT>" + str ( resp_payload [ "<STR_LIT>" ] ) <EOL> sys . exit ( <NUM_LIT:0> ) </s>
