def delete_queue(self, queue_node, if_empty=True):

        results                 = build_dict("FAILED", "Not Found", {})

        try:

            if self.m_channel == None:
                results         = build_dict("FAILED", "Not Connected", {})
            else:
                    
                blocking_ch     = None

                try:
                    durable     = bool(queue_node["Durable"])
                    exclusive   = bool(queue_node["Exclusive"])
                    auto_delete = bool(queue_node["AutoDelete"])

                    # To DELETE a queue exists there needs to be a blocking connection that will return immediately or throw
        
                    # Setup the Credentials
                    credentials = pika.PlainCredentials(self.m_app_config["Account"]["User"], self.m_app_config["Account"]["Password"])

                    # Setup the Connection Parameters
                    conn_params = pika.ConnectionParameters(
                                        host=self.m_app_config["BrokerAddress"][0],
                                        credentials=credentials)

                    # Setup the Connection
                    connection  = pika.BlockingConnection(conn_params)

                    # Setup the Channel
                    blocking_ch = connection.channel()

                    # Delete it if it exists
                    blocking_ch.queue_delete(queue=str(queue_node["Name"]), if_empty=if_empty)

                    queue_obj   = blocking_ch.queue_declare(queue=str(queue_node["Name"]), durable=False, exclusive=True, auto_delete=True, passive=True)
                    if queue_obj != None and queue_obj.method:
                        results = build_dict("SUCCESS", "Found Queue", {
                                                    "Consumers" : str(queue_obj.method.consumer_count),
                                                    "Messages"  : str(queue_obj.method.message_count)
                                                })

                    blocking_ch.close()
                except Exception,h:
                    self.lg("Queue(" + str(queue_node["Name"]) + ") Exists Ex(" + str(h) + ")", 6)
                    results     = build_dict("SUCCESS", "No Queue", {})
                # end of try/ex for getting the queue

        except Exception,k:
            err_msg             = "Failed to run delete_queue with Ex(" + str(k) + ")"
            self.lg("ERROR: " + str(err_msg), 0)
            self.m_status       = "Failed"
            results             = build_dict("FAILED", str(err_msg), {})
        # end of try/ex

        return results
    # end of delete_queue
dataset/ETHPy150Open GetLevvel/message-simulator/src/rabbit_message_publisher.py/RabbitMessagePublisher.delete_queue/original