def receive_deferred_messages(self, sequence_numbers, mode=ReceiveSettleMode.PeekLock):
if not sequence_numbers:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>self._can_run()<EOL>try:<EOL><INDENT>receive_mode = mode.value.value<EOL><DEDENT>except AttributeError:<EOL><INDENT>receive_mode = int(mode)<EOL><DEDENT>message = {<EOL>'<STR_LIT>': types.AMQPArray([types.AMQPLong(s) for s in sequence_numbers]),<EOL>'<STR_LIT>': types.AMQPuInt(receive_mode),<EOL>'<STR_LIT>': self.session_id<EOL>}<EOL>handler = functools.partial(mgmt_handlers.deferred_message_op, mode=receive_mode)<EOL>messages = self._mgmt_request_response(<EOL>REQUEST_RESPONSE_RECEIVE_BY_SEQUENCE_NUMBER,<EOL>message,<EOL>handler)<EOL>for m in messages:<EOL><INDENT>m._receiver = self  <EOL><DEDENT>return messages<EOL>
Receive messages that have previously been deferred.

        This operation can only receive deferred messages from the current session.
        When receiving deferred messages from a partitioned entity, all of the supplied
        sequence numbers must be messages from the same partition.

        :param sequence_numbers: A list of the sequence numbers of messages that have been
         deferred.
        :type sequence_numbers: list[int]
        :param mode: The receive mode, default value is PeekLock.
        :type mode: ~azure.servicebus.common.constants.ReceiveSettleMode
        :rtype: list[~azure.servicebus.common.message.DeferredMessage]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START receive_deferred_messages]
                :end-before: [END receive_deferred_messages]
                :language: python
                :dedent: 4
                :caption: Get the messages which were previously deferred in the session