def _confused_state(self, request: Request) -> Type[BaseState]:
origin = request.register.get(Register.STATE)<EOL>if origin in self._allowed_states:<EOL><INDENT>try:<EOL><INDENT>return import_class(origin)<EOL><DEDENT>except (AttributeError, ImportError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return import_class(settings.DEFAULT_STATE)<EOL>
If we're confused, find which state to call.