Print the choices for this question.

            This may be a empty string and in the case of a list of validators
            we will only show the first validator's choices.
761595
def choices(self):
        
        if isinstance(self.validator, list):
            return self.validator[0].print_choices()
        return self.validator.print_choices()
357282
function listRender (choices, pointer) {
  var output = '';
  var separatorOffset = 0;

  choices.forEach(function (choice, i) {
    if (choice.type === 'separator') {
      separatorOffset++;
      output += '  ' + choice + '\n';
      return;
    }

    var isSelected = (i - separatorOffset === pointer);
    var line = (isSelected ? figures.pointer + ' ' : '  ') + choice.name;
    if (isSelected) {
      line = chalk.cyan(line);
    }
    output += line + ' \n';
  });

  return output.replace(/\n$/, '');
}
1232165
def _get_choices(self):
        
        if not self._choices:
            self._choices = tuple(
                (x.name, getattr(x, 'verbose_name', x.name) or x.name)
                for x in self.choices_class.constants()
            )
        return self._choices
1322140
def prompt(test_input = None):
    
    if test_input != None:
        if type(test_input) == list and len(test_input):
            choice = test_input.pop(0)
        elif type(test_input) == list:
            choice = ''
        else:
            choice = test_input
    else:
        # Coverage: 4 missed statements
        try:
            choice = raw_input()
        except:
            choice = input()
    return choice
1300265
public void print()
    {
        for (int c = 0; c < nCols; ++c) {
            System.out.print("  " + values[0][c]);
        }
        System.out.println();
    }
234688
def print_values(self, parameter):
        
        if parameter in self.VALUES:
            self.print_info(u"Available values for parameter '%s':" % parameter)
            self.print_generic(u"\n".join(self.VALUES[parameter]))
            return self.HELP_EXIT_CODE
        if parameter not in [u"?", u""]:
            self.print_error(u"Invalid parameter name '%s'" % parameter)
        self.print_info(u"Parameters for which values can be listed:")
        self.print_generic(u"\n".join(sorted(self.VALUES.keys())))
        return self.HELP_EXIT_CODE
220656
function listRender(choices, pointer) {
    var output = '';
    var separatorOffset = 0;

    choices.forEach(function (choice, index) {
        if (choice.type === 'separator') {
            separatorOffset++;
            output += "  " + choice + "\n";
            return;
        }

        var isSelected = (index - separatorOffset === pointer);
        var line = (isSelected ? figures.pointer + ' ' : '  ');

        if (choice.isDirectory) {
          if (choice.name === '.') {
            line += '📂  ';
          } else {
            line += '📁  ';
          }
        }
        if (choice.isFile) {
          line += '📄  ';
        }
        line += choice.name;
        if (isSelected) {
          line = chalk.cyan(line);
        }
        output += line + ' \n';
    });

    return output.replace(/\n$/, '');
}
378113
final public void Choice() throws ParseException {
    Or();
    label_6:
    while (true) {
      if (jj_2_5(3)) {
        ;
      } else {
        break label_6;
      }
      jj_consume_token(QUESTIONMARK);
      Choice();
      jj_consume_token(COLON);
                                                         AstChoice jjtn001 = new AstChoice(JJTCHOICE);
                                                         boolean jjtc001 = true;
                                                         jjtree.openNodeScope(jjtn001);
      try {
        Choice();
      } catch (Throwable jjte001) {
                                                         if (jjtc001) {
                                                           jjtree.clearNodeScope(jjtn001);
                                                           jjtc001 = false;
                                                         } else {
                                                           jjtree.popNode();
                                                         }
                                                         if (jjte001 instanceof RuntimeException) {
                                                           {if (true) throw (RuntimeException)jjte001;}
                                                         }
                                                         if (jjte001 instanceof ParseException) {
                                                           {if (true) throw (ParseException)jjte001;}
                                                         }
                                                         {if (true) throw (Error)jjte001;}
      } finally {
                                                         if (jjtc001) {
                                                           jjtree.closeNodeScope(jjtn001,  3);
                                                         }
      }
    }
  }
372463
def get_multiple_choices_required(self):
        
        errors = []
        if self.required:
            msg = _("At least one checkbox has to be selected.")
            errors.append(('$error.multifield', msg))
        return errors
591142
def _choose_from_list(options, question):
    """"""
    message = ""
    for index, value in enumerate(options):
        message += "[{}] {}\n".format(index, value)
    message += "\n" + question

    def valid(n):
        if int(n) not in range(len(options)):
            raise ValueError("Not a valid option.")
        else:
            return int(n)

    prompt(message, validate=valid, key="answer")
    return env.answer
1313775
def validate_options(self):
        
        for option in self._option_list:
            # validate options
            if option.required and option.key not in self._results:
                raise RuntimeError('Option %s is required.' % option.name)
265918
def user_choice(prompt, choices=("yes", "no"), default=None):
    
    assert default is None or default in choices
    choice_list = ', '.join((choice.title() if choice == default else choice for choice in choices))
    response = None
    while response not in choices:
        response = input(prompt + ' [' + choice_list + ']: ')
        response = response.lower() if response else default
    return response
1298746
def get_option_choices(opt_name, opt_value, default_value, all_choices):
    

    choices = []
    if isinstance(opt_value, six.string_types):
        choices = [opt_value]
    elif isinstance(opt_value, (list, tuple)):
        choices = list(opt_value)
    elif opt_value is None:
        choices = default_value
    else:
        raise InvalidOption('Option %s has invalid'
                            ' value: %s' % (opt_name, opt_value))
    if 'all' in choices:
        choices = all_choices
    for item in choices:
        if item not in all_choices:
            raise InvalidOption('Choices of option %s contains invalid'
                                ' item: %s' % (opt_name, item))
    return choices
1201028
def _options_string(self):
        
        if len(self.options) > 0:
            s = ""
            for op in self.options:
                if self._sized_op:
                    s += "{:s}={:s} ".format(*map(str, op))
                else:
                    s += "{:s} ".format(str(op))
            return s.strip()
        else:
            return ""
358138
def choices(self, choices):
        

        if choices is not None and len(choices) > 0:
            self.has_choices = True

        self._choices = choices
600164
def display_options( optlist )
      maxlen = 0
      listout = []
      optlist.each_value do |opt|
	optnames = ''
	if opt.shortname.length == 0
          optnames += '  ' 
	else
	  optnames += OPTION_PREFIX_SHORT + opt.shortname
	end
	optnames += ','
	optnames += OPTION_PREFIX_LONG + opt.longname if opt.longname.length != 0
	optnames += '=[...]' if opt.param == true
	listout << { :n => optnames, :b => opt.brief }
	maxlen = optnames.length if optnames.length > maxlen
      end
      listout.each do |opt|
	print '  ' + opt[:n]
	print "#{' ' * (maxlen - opt[:n].length)}  # "
	puts opt[:b]
      end
    end
193825
def info(self, show_defaults=False):
        
        pprinter = PrettyPrinter(show_options=True, show_defaults=show_defaults)
        print(pprinter.pprint(self._obj))