code: def message_handler(self, target):
          
          def register(handler):
              self._register_message_handler_internal(target, handler)
              handler.unregister_mpv_messages = lambda: self.unregister_message_handler(handler)
              return handler
          return register
docs: Decorator to register a mpv script message handler.
  
          WARNING: Only one handler can be registered at a time for any given target.
  
          To unregister the message handler, call its ``unregister_mpv_messages`` function::
  
              player = mpv.MPV()
              @player.message_handler('foo')
              def my_handler(some, args):
                  print(args)
  
              my_handler.unregister_mpv_messages()