Request a single character input from the user.
769843
def getch():
    """"""

    if sys.platform in ['darwin', 'linux']:
        import termios
        import tty
        file_descriptor = sys.stdin.fileno()
        settings = termios.tcgetattr(file_descriptor)
        try:
            tty.setraw(file_descriptor)
            return sys.stdin.read(1)
        finally:
            termios.tcsetattr(file_descriptor, termios.TCSADRAIN, settings)
    elif sys.platform in ['cygwin', 'win32']:
        import msvcrt
        return msvcrt.getwch()
478661
def prompt(message, default=None, strip=True, suffix=' '):
    
    if default is not None:
        prompt_text = "{0} [{1}]{2}".format(message, default, suffix)
    else:
        prompt_text = "{0}{1}".format(message, suffix)

    input_value = get_input(prompt_text)

    if input_value and strip:
        input_value = input_value.strip()

    if not input_value:
        input_value = default

    return input_value
1125525
def ask(question, default=None):
    
    question = str(question)

    if default:
        question += ' [' + str(default) + ']'

    question += ': '

    reply = raw_input(question)
    return reply if reply else default
545714
def input(self, string='', level=0, prompt='(please respond) '):
        ''''''
        self.report(string, level)
        return input("{0}".format(self._prefix + prompt))
600847
def get_character(self, position, offset=0):
        """"""
        position = self.get_position(position) + offset
        cursor = self.textCursor()
        cursor.movePosition(QTextCursor.End)
        if position < cursor.position():
            cursor.setPosition(position)
            cursor.movePosition(QTextCursor.Right,
                                QTextCursor.KeepAnchor)
            return to_text_string(cursor.selectedText())
        else:
            return ''
272703
def standard_input():
    """"""
    with click.get_text_stream("stdin") as stdin:
        while stdin.readable():
            line = stdin.readline()
            if line:
                yield line.strip().encode("utf-8")
865992
def char(self, c: str) -> None:
        
        if self.peek() == c:
            self.offset += 1
        else:
            raise UnexpectedInput(self, f"char '{c}'")
971087
def get_input_user(entity):
    """"""
    try:
        if entity.SUBCLASS_OF_ID == 0xe669bf46:  # crc32(b'InputUser'):
            return entity
    except AttributeError:
        _raise_cast_fail(entity, 'InputUser')

    if isinstance(entity, types.User):
        if entity.is_self:
            return types.InputUserSelf()
        else:
            return types.InputUser(entity.id, entity.access_hash or 0)

    if isinstance(entity, types.InputPeerSelf):
        return types.InputUserSelf()

    if isinstance(entity, (types.UserEmpty, types.InputPeerEmpty)):
        return types.InputUserEmpty()

    if isinstance(entity, types.UserFull):
        return get_input_user(entity.user)

    if isinstance(entity, types.InputPeerUser):
        return types.InputUser(entity.user_id, entity.access_hash)

    _raise_cast_fail(entity, 'InputUser')
73330
def _try_char(character, backup, encoding=sys.stdout.encoding):
    
    if character.encode(encoding, 'replace') == b'?':
        return backup
    else:
        return character
812906
def get_input(self, more=False):
        """"""
        received = None
        try:
            received = self.prompt.input(more)
        except KeyboardInterrupt:
            print()
            printerr("KeyboardInterrupt")
        except EOFError:
            print()
            self.exit_runner()
        else:
            if received.startswith(exit_chars):
                self.exit_runner()
                received = None
        return received
1362554
def GetWSAActionInput(operation):
    """"""
    attr = operation.input.action
    if attr is not None:
        return attr
    portType = operation.getPortType()
    targetNamespace = portType.getTargetNamespace()
    ptName = portType.name
    msgName = operation.input.name
    if not msgName:
        msgName = operation.name + 'Request'
    if targetNamespace.endswith('/'):
        return '%s%s/%s' %(targetNamespace, ptName, msgName)
    return '%s/%s/%s' %(targetNamespace, ptName, msgName)
128400
public static function prompt()
    {
        $stdin = fopen('php://stdin', 'r');
        $answer = self::trimAnswer(fgets($stdin, 4096));
        fclose($stdin);

        return $answer;
    }
460281
public static String getInput(String name, BufferedReader br)
      throws IOException {
    // prompt the user to enter the given name
    System.out.print("Please Enter " + name + ": ");

    String value = br.readLine();
    return value;
  }
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
747282
def request_echo(self, sock, msg):
        """"""
        return katcp.Message.reply(msg.name, "ok", *msg.arguments)
840422
def ainput(prompt='', *, streams=None, use_stderr=False, loop=None):
    """"""
    # Get standard streams
    if streams is None:
        streams = yield from get_standard_streams(
            use_stderr=use_stderr, loop=loop)
    reader, writer = streams
    # Write prompt
    writer.write(prompt.encode())
    yield from writer.drain()
    # Get data
    data = yield from reader.readline()
    # Decode data
    data = data.decode()
    # Return or raise EOF
    if not data.endswith('\n'):
        raise EOFError
    return data.rstrip('\n')
1266393
function _inputChar(char) {
    if(_charIsPrintable(char.charCodeAt(0))
      &&utils.isSelectable(document.activeElement)) {
      // add the char
      // FIXME: put at caretPosition/replace selected content
      document.activeElement.value += char;
      // fire an input event
      utils.dispatch(document.activeElement, {type: 'input'});
    }
  }