def on_delivery_confirmation(self, method_frame):
        """Invoked by pika when RabbitMQ responds to a Basic.Publish RPC
        command, passing in either a Basic.Ack or Basic.Nack frame with
        the delivery tag of the message that was published. The delivery tag
        is an integer counter indicating the message number that was sent
        on the channel via Basic.Publish. Here we're just doing house keeping
        to keep track of stats and remove message numbers that we expect
        a delivery confirmation of from the list used to keep track of messages
        that are pending confirmation.

        :param pika.frame.Method method_frame: Basic.Ack or Basic.Nack frame

        """
        confirmation_type   = method_frame.method.NAME.split('.')[1].lower()
        percent_done        = "%0.2f" % float(float(method_frame.method.delivery_tag)/float(self.m_number_to_send)*100.00)
        if self.m_debug:
            self.lg("Template(" + str(self.m_cur_message_template) + ") Done(" + str(percent_done) + ") Received(" + str(confirmation_type) + ") Delivery(" + str(method_frame.method.delivery_tag) + "/" + str(self.m_number_to_send) + "))", 6)

        if int(self.m_message_number) % 5000 == 0:
            print   "Template(" + str(self.m_cur_message_template) + ") Done(" + str(percent_done) + ") Received(" + str(confirmation_type) + ") Delivery(" + str(method_frame.method.delivery_tag) + "/" + str(self.m_number_to_send) + ")"

        if confirmation_type == "ack":
            self.m_acked += 1
        elif confirmation_type == "nack":
            self.m_nacked += 1
        self.m_deliveries.remove(method_frame.method.delivery_tag)
        
        log_msg = "Published(" + str(self.m_message_number) + ") messages yet Delivered(" + str(len(self.m_deliveries)) + ") have Acked(" + str(self.m_acked) + ") Nacked(" + str(self.m_nacked) + ")"
        if self.m_debug:
            self.lg(log_msg, 6)

        if self.m_debug:
            self.lg("Continuing Batch for seconds(" + str(self.m_publish_interval) + ")", 6)

        self.m_connection.add_timeout(self.m_publish_interval, self.publish_message)
    # end of on_delivery_confirmation
dataset/ETHPy150Open GetLevvel/message-simulator/src/rabbit_message_publisher.py/RabbitMessagePublisher.on_delivery_confirmation/original