Complete the code to declare a queue named 'task_queue' in RabbitMQ.
channel.queue_declare(queue='[1]')
The queue name must be 'task_queue' to match the intended queue for tasks.
Complete the code to publish a message 'Hello' to the 'task_queue'.
channel.basic_publish(exchange='', routing_key='task_queue', body='[1]')
The message body should be 'Hello' as specified.
Fix the error in the code to consume messages from 'task_queue'.
channel.basic_consume(queue='task_queue', on_message_callback=[1], auto_ack=True)
The callback function must be named 'handle_message' as defined elsewhere to process messages.
Fill both blanks to create a dictionary comprehension that filters messages with priority greater than 5.
filtered = {msg: priority[1] for msg, priority in messages.items() if priority [2] 5}The comprehension multiplies priority by 2 and filters where priority is greater than 5.
Fill all three blanks to create a dictionary of uppercase message keys with their priorities filtered by priority > 3.
result = [1]: [2] for [3], priority in messages.items() if priority > 3}
The keys are uppercase message strings, values are priorities, and the loop variable is 'msg'.