def _init_collections(self):
        uid = self.user.id
        self.dialog_states = DialogStates(
            self._initial_state,
            redis=self._redis,
            key=f'{uid}:ds')

        # User and Bot utterances from newest to oldest
        if self._redis:
            self._utterances = SyncableDeque(
                maxlen=self.SIZE_LIMIT,
                redis=self._redis,
                key=f'{uid}:utterances')  # type: Deque[Union[MessageUnderstanding, ChatAction]]
            self._value_store = SyncableDict(  # type: Dict
                redis=self._redis,
                writeback=True,
                key=f'{uid}:kv_store')
            self._utterances.sync()
            self._value_store.sync()
        else:
            self._utterances = deque()  # type: Deque[Union[MessageUnderstanding, ChatAction]]
            self._value_store = dict()

        self._answered_question_ids = UserAnswers.get_answered_question_ids(self.user)

        self._current_question = None  # type: Question
        self._current_questionnaire = None  # type: Questionnaire

        self._all_done = False  # type: bool
        self._update_question_context()

        # cached property
        self.__last_user_utterance = None  # type: MessageUnderstanding
def ds():
    return DialogStates(INITIAL_STATE)
def get_state_machine():
    return DialogStates(States.SMALLTALK)