def get_a_message(conn, queue): 
  message = None
  try:
    myq = conn.get_queue(queue)
    q_length = myq.count()
    if q_length > 0:
      message = myq.read()
  except:
    raise
  return message
If we have at least one message in the queue, return it.
dataset/ETHPy150Open wcannon/saltconf2015/archived/salt/keymanager/sqs.py/get_a_message