code: def message_handler(stream, type_, from_, cb):
      
  
      stream.register_message_callback(
          type_,
          from_,
          cb,
      )
      try:
          yield
      finally:
          stream.unregister_message_callback(
              type_,
              from_,
          )
docs: Context manager to temporarily register a callback to handle messages on a
      :class:`StanzaStream`.
  
      :param stream: Stanza stream to register the coroutine at
      :type stream: :class:`StanzaStream`
      :param type_: Message type to listen for, or :data:`None` for a wildcard
                    match.
      :type type_: :class:`~.MessageType` or :data:`None`
      :param from_: Sender JID to listen for, or :data:`None` for a wildcard
                    match.
      :type from_: :class:`~aioxmpp.JID` or :data:`None`
      :param cb: Callback to register
  
      The callback is registered when the context is entered and unregistered
      when the context is exited.
  
      .. versionadded:: 0.8