The choice question, pick a single choice.

@return String
764296
public function choice($question, $choices = array(), $allowedMultiple = false)
    {
        $this->output->writeln($question);

        $this->output->writeln(join(',', $choices));

        $answer = $this->input->getInput();

        $valid = $this->validateChoices($answer, $choices, $allowedMultiple);

        if ($valid !== false) {
            return $valid;
        }

        $this->output->writeln($this->wrongChoiceErrorMessage);

        return false;
    }
1280203
public function choice($question, array $choices, $default = null, $attempts = null, $multiple = null)
    {
        $helper = $this->getHelperSet()->get('question');

        $question = new ChoiceQuestion("<question>$question</question> ", $choices, $default);

        $question->setMaxAttempts($attempts)->setMultiselect($multiple);

        return $helper->ask($this->input, $this->output, $question);
    }
310966
public function getChoices()
    {
        /** @var ApiChoice $constraint */
        if ($constraint = $this->docBlockUtility->getConstraint($this->property, ApiChoice::class)) {
            return $constraint->choices;
        }
    }
1186211
public function choose($question, $choice = 'yn', $default = 'n')
    {
        if (!is_string($choice)) {
            $choice = implode('', $choice);
        }

        $lowercase = str_ireplace($default, strtoupper($default), strtolower($choice));
        $choices = trim(implode('/', preg_split('//', $lowercase)), '/');
        $line = $this->prompt(sprintf('%s [%s]', $question, $choices), $default, '');

        if (stripos($choice, $line) !== false) {
            return strtolower($line);
        }

        return strtolower($default);
    }
1256942
public function getChoices()
    {
        $choices = $this->getOrderedRoles();

        if (isset($choices['ROLE_SUPER_ADMIN'])) {
            unset($choices['ROLE_SUPER_ADMIN']);
        }

        if (isset($choices['ROLE_ADMIN']) && !$this->isCurrentUserSuperAdmin()) {
            unset($choices['ROLE_ADMIN']);
        }

        return $choices;
    }
203344
public static function getForSelect()
    {
        $instance = self::_instance();
        return array_combine(array_keys($instance->_items), Hash::extract($instance->_items, '{s}.displayName'));
    }
1324832
protected function determineChoiceField()
    {
        $expanded = $this->options['expanded'];
        $multiple = $this->options['multiple'];

        if ($multiple) {
            $this->options['attr']['multiple'] = true;
        }

        if ($expanded && !$multiple) {
            return $this->choiceType = 'radio';
        }

        if ($expanded && $multiple) {
            return $this->choiceType = 'checkbox';
        }
    }
26254
public function choice($question, array $choices, $default = null)
    {
        if ($default) {
            $values = array_flip($choices);
            $default = $values[$default];
        }

        $question = new ChoiceQuestion($question, $choices, $default);
        $question->setMultiselect(true);

        return $this->askQuestion($question);
    }
202007
private function getSelectQuery()
	{
		$result = $this->getSelectClause();

		if ($join = $this->getJoinClause()) {
			$result .= ' ' . $join;
		}

		if ($where = $this->getWhereClause()) {
			$result .= ' ' . $where;
		}

		if ($groupBy = $this->getGroupByClause()) {
			$result .= ' ' . $groupBy;
		}

		if ($orderBy = $this->getOrderByClause()) {
			$result .= ' ' . $orderBy;
		}

		if ($limit = $this->getLimitClause()) {
			$result .= ' ' . $limit;
		}

		if ($offset = $this->getOffsetClause()) {
			$result .= ' ' . $offset;
		}

		return $result;
	}
1012449
private function getSortFieldChoices()
    {
        $choices = [];
        foreach ($this->getSortFieldValues() as $sortField) {
            $choices[$this->getSortFieldLabel($sortField)] = $sortField;
        }

        return $choices;
    }
328699
public function getFirstSelectedOption()
	{
		foreach ( $this->getOptions() as $option ) {
			if ( $option->isSelected() ) {
				return $option;
			}
		}

		throw new SelectException('No options are selected', SelectException::TYPE_NOT_SELECTED);
	}
57146
def pick(rest):
	""
	question = rest.strip()
	choices = util.splitem(question)
	if len(choices) == 1:
		return "I can't pick if you give me only one choice!"
	else:
		pick = random.choice(choices)
		certainty = random.sample(phrases.certainty_opts, 1)[0]
		return "%s... %s %s" % (pick, certainty, pick)
955944
public function selectPage()
    {
        if ($this->pageTotal <= 1) {
            return '';
        }

        $page = (int)$this->getOption('page', 1);
        $select = ' <select class="page-num-input" style="max-height: 400px"
        onchange="javascript:location.href=\'' . $this->getUrl() . '\'+this.value;">';

        for ($i = 1; $i <= $this->pageTotal; $i++) {
            $select .= ($page === $i) ?
                '<option value="' . $i . '" selected="selected"">' . $i . '</option>' :
                '<option value="' . $i . '" >' . $i . '</option>';
        }

        $select .= '</select> ';

        $this->html['select'] = $select;

        return $this;
    }
531894
private function getSelectQuery()
    {
        return 'SELECT '.(empty($this->parts['select']) ? '*' : implode(', ', $this->parts['select'])).
               ' FROM '.$this->getFromClause().
               (($this->parts['where'] !== null) ? ' WHERE '.$this->parts['where'] : null).
               (!empty($this->parts['group_by']) ? ' GROUP BY '.implode(', ', $this->parts['group_by']) : null).
               (($this->parts['having'] !== null) ? ' HAVING '.$this->parts['having'] : null).
               (!empty($this->parts['order_by']) ? ' ORDER BY '.implode(', ', $this->parts['order_by']) : null).
               (($this->parts['limit'] !== null) ? ' LIMIT '.$this->parts['limit'] : null).
               (($this->parts['offset'] !== null) ? ' OFFSET '.$this->parts['offset'] : null);
    }
1259301
protected function getSimpleQuestion()
    {
        if (!$this->getHelperSet()->has('simple_question')) {
            $this->getHelperSet()->set(new SimpleQuestionHelper());
        }

        return $this->getHelperSet()->get('simple_question');
    }
671360
public function choices()
    {
        $choices = $this->p()->choices();
        foreach ($choices as $ident => $choice) {
            $choice = $this->parseChoice($ident, $choice);

            if (isset($choice['active']) && $choice['active'] === false) {
                continue;
            }

            if (!is_array($choice)) {
                continue;
            }

            yield $ident => $choice;
        }
    }
1002599
public function getChoice($uuid)
    {
        $found = null;
        foreach ($this->choices as $choice) {
            if ($choice->getUuid() === $uuid) {
                $found = $choice;
                break;
            }
        }

        return $found;
    }