def _get_hidden_response(self, output, input_stream):
        """
        Gets a hidden response from user.

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

        :rtype: str
        """
        if platform.system().lower() == 'windows':
            exe = os.path.join(
                os.path.dirname(os.path.realpath(__file__)),
                '..', 'resources', 'bin', 'hiddeninput.exe'
            )

            value = decode(os.popen(os.path.realpath(exe)).read()).strip()
            output.writeln('')

            return value

        if self._has_stty_available():
            stty_mode = decode(subprocess.check_output(['stty', '-g'])).rstrip('\n')

            subprocess.check_output(['stty', '-echo'])
            value = decode(input_stream.readline())
            subprocess.check_output(['stty', '%s' % stty_mode])

            if not value:
                raise Exception('Aborted')

            value = value.strip()
            output.writeln('')

            return value

        raise Exception('Unable to hide the response')
dataset/ETHPy150Open sdispater/cleo/cleo/helpers/question_helper.py/QuestionHelper._get_hidden_response/original