def _do_ask(self, output, question):
        """
        Asks a question to the user.

        :param output: An Output instance
        :type output: Output

        :param question: The question to ask
        :type question: Question

        :rtype: mixed
        """
        self._write_prompt(output, question)

        input_stream = self.input_stream
        autocomplete = question.autocompleter_values

        if autocomplete is None or not self._has_stty_available():
            ret = False

            if question.hidden:
                try:
                    ret = self._get_hidden_response(output, input_stream)
                except RuntimeError:
                    if not question.hidden_fallback:
                        raise

            if not ret:
                ret = self._read_from_input(input_stream)
        else:
            ret = self._autocomplete(output, question, input_stream)

        if len(ret) <= 0:
            ret = question.default

        if question.normalizer:
            return question.normalizer(ret)

        return ret
dataset/ETHPy150Open sdispater/cleo/cleo/helpers/question_helper.py/QuestionHelper._do_ask/original