code: def on_message(self):
          # type: () -> Callable
          
          def decorator(handler):
              # type: (Callable) -> Callable
              self.client.on_message = handler
              return handler
  
          return decorator
docs: Decorator.
  
          Decorator to handle all messages that have been subscribed and that
          are not handled via the `on_message` decorator.
  
          **Note:** Unlike as written in the paho mqtt documentation this
          callback will not be called if there exists an topic-specific callback
          added by the `on_topic` decorator.
  
          **Example Usage:**::
  
              @mqtt.on_message()
              def handle_messages(client, userdata, message):
                  print('Received message on topic {}: {}'
                        .format(message.topic, message.payload.decode()))