def notify(self, frame_type, headers=None, body=None):
        """
        Utility function for notifying listeners of incoming and outgoing messages

        :param frame_type: the type of message
        :param headers: the map of headers associated with the message
        :param body: the content of the message
        """
        if frame_type == 'receipt':
            # logic for wait-on-receipt notification
            receipt = headers['receipt-id']
            with self.__send_wait_condition:
                self.__receipts[receipt] = None
                self.__send_wait_condition.notify()

            # received a stomp 1.1+ disconnect receipt
            if receipt == self.__disconnect_receipt:
                self.disconnect_socket()

        elif frame_type == 'connected':
            self.set_connected(True)

        elif frame_type == 'disconnected':
            self.set_connected(False)

        for listener in self.listeners.values():
            if not listener:
                continue

            notify_func = getattr(listener, frame_type % 'on_%s', None)
            if not notify_func:
                log.debug("listener %s has no method on_%s", listener, frame_type)
                continue
            if frame_type in ('heartbeat', 'disconnected'):
                notify_func()
                continue
            if frame_type == 'connecting':
                notify_func(self.current_host_and_port)
                continue

            if frame_type == 'error' and not self.connected:
                with self.__connect_wait_condition:
                    self.connection_error = True
                    self.__connect_wait_condition.notify()

            rtn = notify_func(headers, body)
            if rtn:
                (headers, body) = rtn
        return (headers, body)
dataset/ETHPy150Open jasonrbriggs/stomp.py/stomp/transport.py/BaseTransport.notify/swapped operands of `%`