Grab user input from command line.

    :param name: prompt text
    :param default: default value if no input provided.
343336
def prompt(name, default=None):
    

    prompt = name + (default and ' [%s]' % default or '')
    prompt += name.endswith('?') and ' ' or ': '
    while True:
        rv = raw_input(prompt)
        if rv:
            return rv
        if default is not None:
            return default
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())
898021
def get_input(self, key, force=False):
        
        if key not in self._inputs:
            raise InputException("Key {0} is not a valid input!".format(key))

        if self._inputs[key].prompt:
            prompt = self._inputs[key].prompt
        elif self._inputs[key].is_bool():
            prompt = "{0}?".format(key)
        else:
            prompt = "please enter your {0}".format(key)
        help_text = self._inputs[key].help if hasattr(self._inputs[key], 'help') else None

        if self._inputs[key].value is EMPTY or force:

            default_value = None
            if self._inputs[key].default is not EMPTY:
                default_value = self._inputs[key].default
            if self._inputs[key].value is not EMPTY:
                default_value = self._inputs[key].value

            input_value = EMPTY
            while input_value is EMPTY or input_value == '?':
                if input_value == '?' and help_text:
                    print(help_text)
                input_value = lib.prompt(
                    prompt,
                    default=default_value,
                    bool_type=self._inputs[key].in_type,
                    secret=self._inputs[key].is_secret)
            self._inputs[key].value = input_value

        return self._inputs[key].value
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
622155
def prompt(msg, default=NO_DEFAULT, validate=None):
    
    while True:
        response = input(msg + " ").strip()
        if not response:
            if default is NO_DEFAULT:
                continue
            return default
        if validate is None or validate(response):
            return response
139521
def get_argument(self, name, default=None, strip=True):
        
        return self._get_argument(name, default, self.request.arguments, strip)[name]
215320
def _deliver_prompt(p)
      default = p.default
      unless @configurator.nil?
        section_sym = p.config_section.to_sym

        # If a Configurator has been included, replace relevant
        # prompt defaults with those values from the Configurator.
        unless @configurator.data[section_sym].nil?
          config_val = @configurator.data[section_sym][p.config_key.to_sym]
          default = config_val unless config_val.nil?
        end
      end

      p.deliver(default)
    end
1084997
def input(self, more=False):
        """"""
        sys.stdout.flush()
        if more:
            msg = more_prompt
        else:
            msg = main_prompt
        if self.style is not None:
            internal_assert(prompt_toolkit is not None, "without prompt_toolkit cannot highlight style", self.style)
            try:
                return self.prompt(msg)
            except EOFError:
                raise  # issubclass(EOFError, Exception), so we have to do this
            except (Exception, AssertionError):
                logger.display_exc()
                logger.show_sig("Syntax highlighting failed; switching to --style none.")
                self.style = None
        return input(msg)
36498
def prompt(prompt_string, default=None, secret=False, boolean=False, bool_type=None):
    
    if boolean or bool_type in BOOLEAN_DEFAULTS:
        if bool_type is None:
            bool_type = 'y_n'
        default_msg = BOOLEAN_DEFAULTS[bool_type][is_affirmative(default)]
    else:
        default_msg = " (default {val}): "
    prompt_string += (default_msg.format(val=default) if default else ": ")
    if secret:
        val = getpass(prompt_string)
    else:
        val = input(prompt_string)
    val = (val if val else default)
    if boolean:
        val = val.lower().startswith('y')
    return val
1151470
def input(prompt=""):
	""""""
	
	string = stdin_decode(raw_input(prompt))
	
	caller_frame = sys._getframe(1)
	globals = caller_frame.f_globals
	locals = caller_frame.f_locals
	
	return eval(string, globals, locals)
1289208
def call(self, name, options=None, o=None):
        
        if options is None:
            options = []

        command = self.get_application().find(name)

        options = [('command', command.get_name())] + options

        return command.run(ListInput(options), o)
909026
def default(self, user_input):
        '''  '''
        try:
            for i in self._cs.disasm(unhexlify(self.cleanup(user_input)), self.base_address):
                print("0x%08x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str))
        except CsError as e:
            print("Error: %s" %e)
805219
async def prompt(self, text=None):
        '''
        
        '''
        if self.sess is None:
            hist = FileHistory(s_common.getSynPath('cmdr_history'))
            self.sess = PromptSession(history=hist)

        if text is None:
            text = self.cmdprompt

        with patch_stdout():
            retn = await self.sess.prompt(text, async_=True, vi_mode=self.vi_mode, enable_open_in_editor=True)
            return retn
893463
def _user_input() -> str:
    

    lines = []
    try:
        while True:
            line = input()
            if line != '':
                lines.append(line)
            else:
                break
    except (EOFError, KeyboardInterrupt):
        return '\n'.join(lines)
602078
def prompt_stdin(prompt):
    """"""
    # raw_input returns the empty string for "enter"
    yes = set(['yes', 'y'])
    no = set(['no','n'])

    try:
        print(prompt)
        if sys.version_info>=(3,0):
            choice = input().lower()
        else:
            choice = raw_input().lower()
        # would like to test for which exceptions here
    except:
        print('Stdin is not implemented.')
        print('You need to set')
        print('overide_manual_authorize=True')
        print('to proceed with the download. Please set that variable and continue.')
        raise


    if choice in yes:
        return True
    elif choice in no:
        return False
    else:
        print("Your response was a " + choice)
        print("Please respond with 'yes', 'y' or 'no', 'n'")
249280
def prompt(p, yes_no=false)
      puts #newline for newline's sake!

      loop do
        print p, ' '
        line = STDIN.readline.strip
        if yes_no
          return true if line =~ YES
          return false if line =~ NO
        else
          return line
        end
      end
    end
485089
def on_input_timeout(self, cli):
        
        document = cli.current_buffer.document
        text = document.text

        text = text.replace('az ', '')
        if self.default_command:
            text = self.default_command + ' ' + text

        param_info, example = self.generate_help_text()

        self.param_docs = u'{}'.format(param_info)
        self.example_docs = u'{}'.format(example)

        self._update_default_info()

        cli.buffers['description'].reset(
            initial_document=Document(self.description_docs, cursor_position=0))
        cli.buffers['parameter'].reset(
            initial_document=Document(self.param_docs))
        cli.buffers['examples'].reset(
            initial_document=Document(self.example_docs))
        cli.buffers['default_values'].reset(
            initial_document=Document(
                u'{}'.format(self.config_default if self.config_default else 'No Default Values')))
        self._update_toolbar()
        cli.request_redraw()