def stop(self):
        """Stop the example by closing the channel and connection. We
        set a flag here so that we stop scheduling new messages to be
        published. Restart the ioloop if we have not received all the message ack/nack's
        by now

        """

        if not self.m_stopping:
            self.lg("Starting Stopping", 6)
            self.stop_consumers()
            self.m_stopping = True

            self.close_channel()
            
            self.close_connection()
        
            if int(self.m_acked + self.m_nacked) >= self.m_num_amqp_msgs:
                self.lg("All mesages received a response Stopping ioloop", 6)
                self.m_connection.ioloop.stop()
            else:
                self.lg("All mesages have not responded Starting ioloop Acked(" + str(self.m_acked) + ") Nacked(" + str(self.m_nacked) - ") Expected(" + str(self.m_num_amqp_msgs) + ")", 6)
                self.m_connection.ioloop.start()

            self.lg("Done Stopping", 6)

    # end of stop
dataset/ETHPy150Open GetLevvel/message-simulator/src/rabbit_message_publisher.py/RabbitMessagePublisher.stop/operator `+` -> `-`