Prompts the user for a string.
344579
def ask_str(msg="Enter a string", dft=None, vld=None, shw=True, blk=True, hlp=None):
    """"""
    vld = vld or [str]
    return ask(msg, dft=dft, vld=vld, shw=shw, blk=blk, hlp=hlp)
455263
@Override
	public boolean promptYesNo(String message) {
		List<String> possibleValues = Arrays.asList(new String[] { "y", "n" });
		message += " (y/n): ";
		String line;

		do {
			line = new String(console.readLine(message));

			if (line != null && !possibleValues.contains(line)) {
				console.printf("Invalid selection");
			}
		} while (line == null || !possibleValues.contains(line));

		return "y".equalsIgnoreCase(line);
	}
804859
def prompt(text='', title='' , default='', root=None, timeout=None):
    """"""
    assert TKINTER_IMPORT_SUCCEEDED, 'Tkinter is required for pymsgbox'
    return __fillablebox(text, title, default=default, mask=None,root=root, timeout=timeout)
1171580
function prompt (data, key, prompt, done) {
  // skip prompts whose when condition is not met
  if (prompt.when && !evaluate(prompt.when, data)) {
    return done()
  }

  var promptDefault = prompt.default
  if (typeof prompt.default === 'function') {
    promptDefault = function () {
      return prompt.default.bind(this)(data)
    }
  }

  inquirer.prompt([{
    type: promptMapping[prompt.type] || prompt.type,
    name: key,
    message: prompt.message || prompt.label || key,
    default: promptDefault,
    choices: prompt.choices || [],
    validate: prompt.validate || function () { return true }
  }], function (answers) {
    if (Array.isArray(answers[key])) {
      data[key] = {}
      answers[key].forEach(function (multiChoiceAnswer) {
        data[key][multiChoiceAnswer] = true
      })
    } else if (typeof answers[key] === 'string') {
      data[key] = answers[key].replace(/"/g, '\\"')
    } else {
      data[key] = answers[key]
    }
    done()
  })
}
1263849
def yn_prompt(text):
    '''
        
    '''

    text = "\n"+ text + "\n('y' or 'n'): "


    while True:
        answer = input(text).strip()
        if answer != 'y' and answer != 'n':
            continue
        elif answer == 'y':
            return True
        elif answer == 'n':
            return False
712762
def _get_user_input(prompt, key_name, parent, input_func=raw_input):
    """"""
    val = input_func(prompt)
    ElementTree.SubElement(parent, "key").text = key_name
    if isinstance(val, bool):
        string_val = "true" if val else "false"
        ElementTree.SubElement(parent, string_val)
    else:
        ElementTree.SubElement(parent, "string").text = val
    return val
587235
def prompt(*args, **kwargs):
    """"""
    try:
        return click.prompt(*args, **kwargs)
    except click.Abort:
        return False
721481
def promptyn(msg, default=None):
    
    while True:
        yes = "Y" if default else "y"
        if default or default is None:
            no = "n"
        else:
            no = "N"
        confirm = prompt("%s [%s/%s]" % (msg, yes, no), "").lower()
        if confirm in ("y", "yes"):
            return True
        elif confirm in ("n", "no"):
            return False
        elif not confirm and default is not None:
            return default
812299
protected void assureInputFromUser(final String prompt, final String initValue, final List<String> options,
                                       final Consumer<String> setter) {
        final String option = findElementInOptions(options, initValue);
        if (option != null) {
            info(FOUND_VALID_VALUE);
            setter.accept(option);
            return;
        }

        out.printf("Choose from below options as %s %n", prompt);
        for (int i = 0; i < options.size(); i++) {
            out.printf("%d. %s%n", i, options.get(i));
        }

        assureInputFromUser("Enter index to use: ", null,
            str -> {
                try {
                    final int index = Integer.parseInt(str);
                    return 0 <= index && index < options.size();
                } catch (Exception e) {
                    return false;
                }
            },
            "Invalid index.", str -> {
                final int index = Integer.parseInt(str);
                setter.accept(options.get(index));
            }
        );
    }
545714
def input(self, string='', level=0, prompt='(please respond) '):
        ''''''
        self.report(string, level)
        return input("{0}".format(self._prefix + prompt))
836734
def prompt(name, default=None):
    

    prompt = name + (default and ' [%s]' % default or '')
    prompt += name.endswith('?') and ' ' or ': '
    while True:
        try:
            rv = raw_input(prompt)
        except NameError:
            rv = input(prompt)
        if rv:
            return rv
        if default is not None:
            return default
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
818267
def ask_user_for_telemetry():
    
    answer = " "
    while answer.lower() != 'yes' and answer.lower() != 'no':
        answer = prompt(u'\nDo you agree to sending telemetry (yes/no)? Default answer is yes: ')

        if answer == '':
            answer = 'yes'

    return answer
625895
def _PromptUserForInput(self, input_text):
    
    self._output_writer.Write('{0:s}: '.format(input_text))
    return self._input_reader.Read()
1240158
def ask_confirmation(prompt = 'Continue?', default = false)
      a = ''
      s = default ? '[Y/n]' : '[y/N]'
      d = default ? 'y' : 'n'
      until %w[y n].include? a
        a = ask("#{prompt} #{s} ") { |q| q.limit = 1; q.case = :downcase }
        a = d if a.length.zero?
      end
      a == 'y'
    end
1127270
def _prompt(self, prompt=None):
        
        if prompt:
            # Print the prompt
            self.write(prompt)
            self.output.flush()

        # Read the line
        return to_str(self.input.readline())
686835
def text(self, prompt, default=None):
        """"""
        prompt = prompt if prompt is not None else 'Enter some text'
        prompt += " [{0}]: ".format(default) if default is not None else ': '
        return self.input(curry(filter_text, default=default), prompt)