def send(self, message):
if not isinstance(message, Message):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if not self.running:<EOL><INDENT>self.open()<EOL><DEDENT>if self.session_id and not message.properties.group_id:<EOL><INDENT>message.properties.group_id = self.session_id<EOL><DEDENT>try:<EOL><INDENT>self._handler.send_message(message.message)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise MessageSendFailed(e)<EOL><DEDENT>
Send a message and blocks until acknowledgement is received or the operation fails.

        :param message: The message to be sent.
        :type message: ~azure.servicebus.common.message.Message
        :raises: ~azure.servicebus.common.errors.MessageSendFailed if the message fails to send.

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START send_message]
                :end-before: [END send_message]
                :language: python
                :dedent: 4
                :caption: Send a message and block