def input(self, prompt,
              hint=None, validators=None, repeat_until_valid=False, task=None, leave_when_cancel=None, **kwargs):
        has_default = kwargs in 'default'
        default = kwargs.get('default', None)

        leave_when_cancel = leave_when_cancel or bool(task)

        message_components = [prompt, ' ']
        if hint is not None:
            message_components.append('({0})'.format(hint))
        if has_default:
            message_components.append('[{0}]'.format(default))
        message = ''.join(message_components).strip() + ': '

        while True:
            has_result = True
            try:
                result = six.moves.input(message).strip()
            except KeyboardInterrupt:
                self.show('')
                error_msg = 'User cancelled input.'
                self.error(error_msg)
                if task and leave_when_cancel:
                    task.exit(1)
            else:
                # Default value
                if (result is None or len(result) == 0) and has_default:
                    result = default
                # Validate
                if validators:
                    for validator in validators:
                        try:
                            result = validator(result)
                        except Exception as e:
                            has_result = False
                            if has_default:
                                result = validator(default)
                            else:
                                self.error(str(e))
                                break
                # Return rt repeat
                if not repeat_until_valid or has_result:
                    return result
dataset/ETHPy150Open sodastsai/taskr/taskr/terminal.py/Console.input/swapped operands of `in`