def _request_while(self, option_name, options, kls, default_option, one_line_options=False):
        str_list_options = ""
        if options:
            str_list_options = "(/o list options)"

        while True:
            #logger.debug("Request to user...")
            str_ = ''
            if not default_option:
                str_ = self.request_string("Enter %s %s" % (option_name, str_list_options))
            else:
                str_ = self.request_string("Enter %s (default:%s) %s"
                                           % (option_name, default_option, str_list_options))
            if str_ == '/o':
                self.print_options(options, one_line_options)
            else:
                if str_ == '' and default_option:
                    return default_option
                if str_.lower() == 'none' and ('none' in options or 'None' in options):
                    return None
                ret = None
                try:
                    ret = kls(str_) if kls is not None else str_
                    if len(options) == 0 or ret in options:
                        return ret
                except (BiiException, __HOLE__):
                    pass
                self.out.error("%s is not a valid %s \n" % (str_, option_name))
                self.print_options(options, one_line_options)
dataset/ETHPy150Open biicode/client/shell/userio.py/UserIO._request_while