POSIX implementation of get char/key.
517808
def _getch():
    '''  '''
    import tty

    with TermStack() as fd:
        tty.setraw(fd)
        return sys.stdin.read(1)
950100
def get_char(prompt=None):
    
    while True:
        s = get_string(prompt)
        if s is None:
            return None
        if len(s) == 1:
            return s[0]

        # Temporarily here for backwards compatibility
        if prompt is None:
            print("Retry: ", end="")
914420
def get_keys_charset(keys, bid):
    
    # use the keys found to sample possible chars
    chars = set()
    for k in keys:
        chars.update(k[:4])
    remainder = chars

    # Normalize charsets for matching
    normalized = {}
    for n, sset in [
        ("p", set(string.punctuation)),
        ("w", set(string.whitespace))
    ]:
        m = chars.intersection(sset)
        if m:
            normalized[n] = m
            remainder = remainder.difference(sset)

    # Detect character sets
    charset = None
    for candidate in CharSet.charsets():
        if remainder.issubset(candidate):
            charset = candidate
            break

    if charset is None:
        raise ValueError(
            "Bucket: %s Failed charset ngram detection %r\n%s" % (
                bid, "".join(chars)), "\n".join(sorted(keys)))

    for n, sset in normalized.items():
        charset = charset.symmetric_difference(sset)

    return charset
379153
def get(self, key, *, encoding=_NOTSET):
        """"""
        return self.execute(b'GET', key, encoding=encoding)
1120281
private static String key2Str(Key k, byte type) {
    String s = key2Str_impl(k, type);
    Key x;
    assert (x = str2Key_impl(s)).equals(k) : "bijection fail " + k + "." + (char) type + " <-> " + s + " <-> " + x;
    return s;
  }
1124168
private int getDataIndexOfKey(Object key) {
    int dataSize = this.size << 1;
    Object[] data = this.data;
    for (int i = 0; i < dataSize; i += 2) {
      Object k = data[i];
      if (key == null ? k == null : key.equals(k)) {
        return i;
      }
    }
    return -2;
  }
414471
def lookup_character_keycode(self, character):
        
        keysym = self.string_to_keysym.get(character, 0)
        if keysym == 0:
            keysym = self.string_to_keysym.get(KEYSYMS[character], 0)
        return self.display.keysym_to_keycode(keysym)
1070415
function (c) {

// If a c parameter is provided, verify that it matches the current character.

            if (c && c !== ch) {
                error("Expected '" + c + "' instead of '" + ch + "'");
            }

// Get the next character. When there are no more characters,
// return the empty string.

            ch = text.charAt(at);
            at += 1;
            return ch;
        }
775743
public final String getString(final int pos, String charsetName) {
        if (pos >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + pos);

        byte[] buf = buffer;
        final int len = (0xff & buf[origin + pos]);
        if (pos + len + 1 > limit) throw new IllegalArgumentException("limit excceed: " + (pos + len + 1));

        try {
            return new String(buf, origin + pos + 1, len, charsetName);
        } catch (UnsupportedEncodingException e) {
            throw new IllegalArgumentException("Unsupported encoding: " + charsetName, e);
        }
    }
1230671
public Character getCharacter(Class<?> aClass,String key,char defaultValue)
   {
	   String results = getText(aClass,key, "");
	   
	   if(results.length() == 0)
		   return Character.valueOf(defaultValue);
	   else return Character.valueOf(results.charAt(0));//return first character
	   
   }
426842
def nth_char(char_map, index):
    """"""
    for char in char_map:
        if index < char_map[char]:
            return char
        index = index - char_map[char]
    return None
91803
def read_char
      input = $stdin.getch
      return input unless input == "\e"
      begin
        Timeout.timeout(0.01) do
          input += $stdin.getch
          input += $stdin.getch
        end
      rescue Timeout::Error
        # ignored
      end
      input
    end
104662
synchronized char getChar(long index) {
        int i = loadBufferIfNeeded(index);
        int ch1 = ((int) dumpBuffer[i++]) & 0xFF;
        int ch2 = ((int) dumpBuffer[i]) & 0xFF;

        return (char) ((ch1 << 8) + (ch2 << 0));
    }
607704
def _getChar(self, char_spec):
        
        if len(char_spec) >= 4 and all(c in string.hexdigits for c in char_spec):
            char_number = int(char_spec, 16)
            if char_number not in range(0x110000):
                raise ValueError('No such character')
            return chr(char_number)
        elif len(char_spec) == 1:
            return char_spec
        else:
            raise ValueError('No such character')
643256
function getCharAt (index) {
    var code = this.charCodeAt(index);

    // BMP
    if (code < 0xD800 || code > 0xDFFF) {
        return String.fromCharCode(code);
    }

    // high surrogate
    if (code < 0xDC00) {
        // access the low surrogate
        var nextCode = this.charCodeAt(index + 1);
        if (isNaN(nextCode)) return false;
        if (nextCode < 0xDC00 || nextCode > 0xDFFF) return false;

        return String.fromCharCode(code, nextCode);
    } else {
        // low surrogate
        return false;
    }
}
1119057
def default_char(self):
        """"""
        reverse = mo.DECSCNM in self.mode
        return Char(data=" ", fg="default", bg="default", reverse=reverse)
613837
def Char(self, char, n = 1, dl = 0):
        
        if len(char) == 1:
            self.Delay(dl)
            self.keyboard.tap_key(char)
        else:
            raise Exception("""method "Char()" can only take one character.""")