<s> """<STR_LIT>""" <EOL> import click <EOL> import SoftLayer <EOL> from SoftLayer . CLI import environment <EOL> from SoftLayer . CLI import mq <EOL> @ click . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . option ( '<STR_LIT>' , <EOL> default = <NUM_LIT:1> , <EOL> show_default = True , <EOL> type = click . INT , <EOL> help = "<STR_LIT>" ) <EOL> @ click . option ( '<STR_LIT>' , <EOL> is_flag = True , <EOL> help = "<STR_LIT>" ) <EOL> @ click . option ( '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> @ click . option ( '<STR_LIT>' , <EOL> type = click . Choice ( [ '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> help = "<STR_LIT>" ) <EOL> @ environment . pass_env <EOL> def cli ( env , account_id , queue_name , count , delete_after , datacenter , network ) : <EOL> """<STR_LIT>""" <EOL> manager = SoftLayer . MessagingManager ( env . client ) <EOL> mq_client = manager . get_connection ( account_id , <EOL> datacenter = datacenter , network = network ) <EOL> messages = mq_client . pop_messages ( queue_name , count ) <EOL> formatted_messages = [ ] <EOL> for message in messages [ '<STR_LIT>' ] : <EOL> formatted_messages . append ( mq . message_table ( message ) ) <EOL> if delete_after : <EOL> for message in messages [ '<STR_LIT>' ] : <EOL> mq_client . delete_message ( queue_name , message [ '<STR_LIT:id>' ] ) <EOL> env . fout ( formatted_messages ) </s>
