def get_queue_details(self, queue_node, delete_flag=False, 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 detect 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()
                    queue_obj   = blocking_ch.queue_declare(queue=str(queue_node["Name"]), durable=durable, exclusive=exclusive, auto_delete=auto_delete, passive=True)

                    if queue_obj != None and queue_obj.method:

                        if delete_flag:

                            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=durable, exclusive=exclusive, auto_delete=auto_delete, passive=True)
                            if queue_obj != None and queue_obj.method:
                                self.lg("ERROR: Failed to Delete Queue(" + str(queue_node["Name"]) + ") via Flag Deletion", 0)
                                results     = build_dict("SUCCESS", "Found Queue", {
                                                    "Queue"     : str(queue_node["Name"]),
                                                    "Consumers" : str(queue_obj.method.consumer_count),
                                                    "Messages"  : str(queue_obj.method.message_count)
                                                })
                            else:
                                results     = build_dict("SUCCESS", "No Queue", {})
                            # end of delete confirmation

                        else:
                            results         = build_dict("SUCCESS", "Found Queue", {
                                                    "Queue"     : str(queue_node["Name"]),
                                                    "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 get_queue_details 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 get_queue_details
From an array of compact tokens and aligned array of document indices
dataset/ETHPy150Open GetLevvel/message-simulator/src/rabbit_message_publisher.py/RabbitMessagePublisher.get_queue_details--crossover with--dataset/ETHPy150Open cemoody/lda2vec/lda2vec/corpus.py/Corpus.compact_to_coocurrence