<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def receive(host, timeout):
 """ Print all messages in queue. Args: host (str):
 Specified --host. timeout (int):
 How log should script wait for message. """

    parameters = settings.get_amqp_settings()[host]

    queues = parameters["queues"]
    queues = dict(map(lambda (x, y): (y, x), queues.items()))  # reverse items
    queue = queues[parameters["out_key"]]

    channel = _get_channel(host, timeout)
    for method_frame, properties, body in channel.consume(queue):
        print json.dumps({
            "method_frame": str(method_frame),
            "properties": str(properties),
            "body": body
        })
        print "-" * 79
        print

        channel.basic_ack(method_frame.delivery_tag)