<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list(declared, undeclared):
 """List configured queues."""

    queues = current_queues.queues.values()
    if declared:
        queues = filter(lambda queue: queue.exists, queues)
    elif undeclared:
        queues = filter(lambda queue: not queue.exists, queues)
    queue_names = [queue.routing_key for queue in queues]
    queue_names.sort()
    for queue in queue_names:
        click.secho(queue)