Prompt user for input and return the entered value.
17806
def ask_input(self, prompt):
        """"""
        self._vim.command('call inputsave()')
        self._vim.command('let user_input = input("{} ")'.format(prompt))
        self._vim.command('call inputrestore()')
        response = self._vim.eval('user_input')
        self._vim.command('unlet user_input')
        return response
528554
def quick_str_input(prompt, default_value):
        
        valid = False
        str_val = default_value
        while not valid:
            input_val = raw_input(prompt + "[{0}]: ".format(default_value))

            if input_val == "":
                str_val = default_value
                valid = True
            else:
                try:
                    str_val = text_type(input_val)
                    valid = True

                except ValueError:
                    print("ERROR: must be text.")
                    valid = False

        return str_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
461931
def prompt_for_input(message, input_type=None):
    """"""
    while True:
        output = prompt.query(message)

        if input_type:
            try:
                output = input_type(output)
            except ValueError:
                error_message('Invalid input type')
                continue

        break

    return output
625895
def _PromptUserForInput(self, input_text):
    
    self._output_writer.Write('{0:s}: '.format(input_text))
    return self._input_reader.Read()
210487
def prompt_for_value(self, ctx):
        
        # Calculate the default before prompting anything to be stable.
        default = self.get_default(ctx)

        # If this is a prompt for a flag we need to handle this
        # differently.
        if self.is_bool_flag:
            return confirm(self.prompt, default)

        return prompt(self.prompt, default=default, type=self.type,
                      hide_input=self.hide_input, show_choices=self.show_choices,
                      confirmation_prompt=self.confirmation_prompt,
                      value_proc=lambda x: self.process_value(ctx, x))
922008
def choose(self, prompt, items, default=None):
        
        if default is not None and (default >= len(items) or default < 0):
            raise IndexError
        prompt = prompt if prompt is not None else "Choose from following:"
        self.show(prompt + '\n')
        self.show("\n".join(number(items)))  # show the items
        prompt = "Enter number of chosen item"
        prompt += " [{0}]: ".format(default) if default is not None else ': '
        return items[self.input(
            curry(filter_int, default=default, start=0, stop=len(items)),
            prompt
        )]
579506
def _select_input(self):
        """"""
        line, index = self.get_position('eof')
        if self.current_prompt_pos is None:
            pline, pindex = line, index
        else:
            pline, pindex = self.current_prompt_pos
        self.setSelection(pline, pindex, line, index)
1128248
def raw_input_replacement(self, prompt=''):
        """"""
        self.widget_proxy.wait_input(prompt)
        self.input_condition.acquire()
        while not self.widget_proxy.data_available():
            self.input_condition.wait()
        inp = self.widget_proxy.input_data
        self.input_condition.release()
        return inp
609057
def input_string prompt="Insert: ", maxlen=80
      #ret, str = rb_getstr(@form.window, $error_message_row, $error_message_col,  prompt, maxlen, config)
      ret, str = rb_getstr(@form.window, $error_message_row, $error_message_col,  prompt, maxlen, config)
      #return str if ret == 0
      #return ""
    end
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)
1261025
def start_prompt(self):
        """"""
        logger.show("Coconut Interpreter:")
        logger.show("(type 'exit()' or press Ctrl-D to end)")
        self.start_running()
        while self.running:
            try:
                code = self.get_input()
                if code:
                    compiled = self.handle_input(code)
                    if compiled:
                        self.execute(compiled, use_eval=None)
            except KeyboardInterrupt:
                printerr("\nKeyboardInterrupt")
545714
def input(self, string='', level=0, prompt='(please respond) '):
        ''''''
        self.report(string, level)
        return input("{0}".format(self._prefix + prompt))
354897
def enter_config_value(self, key, default=""):
        ''' 
        '''
        value = input('Please enter a value for ' + key + ': ')
        if value:
            return value
        else:
            return default
588506
def interactive_prompt(message, parameters, default_opts):
    

    # pretty-print the message
    lines = message.split('\n')
    max_line_len = max([len(l) for l in lines])

    print('-' * max_line_len)
    print(message)
    print('-' * max_line_len)

    ret = {}
    for param in parameters:
        formatted_param = param
        prompt_str = '{}: '.format(formatted_param)
        if param in default_opts:
            prompt_str = '{} (default: "{}"): '.format(formatted_param, default_opts[param])

        try:
            value = raw_input(prompt_str)
        except KeyboardInterrupt:
            log.debug('Exiting on keyboard interrupt')
            sys.exit(0)

        if len(value) > 0:
            ret[param] = value
        elif param in default_opts:
            ret[param] = default_opts[param]
        else:
            ret[param] = None

    return ret
1315143
def get_input(*args, secret=False, required=False, blank=False, **kwargs):
    

    while True:
        if secret:
            value = getpass.getpass(*args, **kwargs)
        else:
            value = input(*args, **kwargs)

        if blank:
            value = value if value else None

        if not required or value:
            break

    return value
386279
def prompt_for_credentials(username):
    '''

    '''
    message = 'Enter password for user "{0}": '.format(username)
    password = getpass.getpass(message)
    if not password:
        raise ValueError(
            'No credentials provided for user "{0}"'.format(username)
        )
    return password