def METHOD_NAME(self, last_received_sequence_no):
    """
    Updates the last received sequence number.  If the sequence number is
    within the valid window, packets before the sequence number within the
    window are removed, and the last received sequence number is updated,
    thus moving the window for the next call.  If the sequence number is
    not within the valid window, it is assumed to be invalid and so is
    ignored.
    :param int last_received_sequence_no: The new sequence number
    :return: True if update went ahead, False if it was ignored
    :rtype: bool
    """
    # The sequence number window is between the last received and
    # the last received + window size, taking account that the end
    # of the window might wrap
    min_seq_no_acceptable = self._last_received_sequence_number
    max_seq_no_acceptable = (
        (min_seq_no_acceptable + self._n_sequences_per_transmission)
        % _N_SEQUENCES)
    if (min_seq_no_acceptable <= last_received_sequence_no <=
            max_seq_no_acceptable):
        # The sequence hasn't wrapped and the sequence is valid
        self._last_received_sequence_number = last_received_sequence_no
        self._remove_messages()
        return True
    elif max_seq_no_acceptable < min_seq_no_acceptable:
        # The sequence has wrapped
        if (0 <= last_received_sequence_no <= max_seq_no_acceptable or
                min_seq_no_acceptable <= last_received_sequence_no <=
                _N_SEQUENCES):
            # The sequence is in the valid range
            self._last_received_sequence_number = last_received_sequence_no
            self._remove_messages()
            return True
    # If none of the above match, the sequence is out of the window
    return False