Get a key from the keyboard as a string

    A 'key' will be a single char, or the name of an extended key
544187
def get_key():
    
    character_name = chr
    codes = _get_keycodes()
    if len(codes) == 1:
        code = codes[0]
        if code >= 32:
            return character_name(code)
        return control_key_name(code)
    return get_extended_key_name(codes)
801050
public StringBuffer getMessageKey(StringBuffer sb)
    {
        if ((this.getKeyInformation() & NOT_UNIQUE) == 0)
        {
            if (sb == null)
                sb = new StringBuffer();
            boolean bCompoundDataAdded = false;
            if ((this.getKeyInformation() & COMPOUND_PARAM) != 0)
            {
                String strSaveKey = this.getKey();
                String strBaseParam = strSaveKey;
                if (Character.isDigit(strSaveKey.charAt(strSaveKey.length() - 1)))
                    strBaseParam = strSaveKey.substring(0, strSaveKey.length() - 1);
                int iMaxParam = this.getKeyInformation() & COMPOUND_MASK;
                if (iMaxParam == 0)
                    iMaxParam = COMPOUND_MASK;
                for (int i = 1; i <= iMaxParam; i++)
                {
                    this.setKey(strBaseParam + Integer.toString(i));
                    String data = this.getString();
                    if (data != null)
                    {
                        if (sb.length() > 0)
                            sb.append('/');
                        sb.append(data);
                        if (data.length() > 0)
                            bCompoundDataAdded = true;
                    }
                    else
                        if (iMaxParam == COMPOUND_MASK)
                            break;  // If there are a unlimited number of params, stop on first null.
                }
                this.setKey(strSaveKey);
            }
            if (!bCompoundDataAdded)
            {
                if (sb.length() > 0)
                    sb.append('/');
                String data = this.getString();
                if (data != null)
                    sb.append(data);
            }
        }
        return sb;
    }
1129466
def _encode_key(self, key):
        
        if isinstance(key, str) or isinstance(key, unicode):
            key = key.encode(self._keyencoding)
        elif not isinstance(key, bytes):
            raise TypeError("key must be bytes or str")
        return codecs.encode(key, 'hex_codec').decode(self._keyencoding)
797759
def fetch_key(key)
      string_key = key.to_s
      keys.detect { |k| k.to_s.casecmp(string_key) == 0 }
    end
495174
def get_key(s):
    '''
    
    '''
    start = s.find("[")
    end = s.find("]")
    if start == -1 or end == -1:
        return None
    if s[start + 1] == "'":
        start += 1
    if s[end - 1] == "'":
        end -= 1
    return s[start + 1:end]
35645
public String getCacheKey(String name, Tree params, String... keys) {
		if (params == null) {
			return name;
		}
		StringBuilder key = new StringBuilder(128);
		key.append(name);
		key.append(':');
		serializeKey(key, params, keys);
		return key.toString();
	}
11410
def access_key(root, key, sep='.', default=None):
    '''
    
    '''
    props = key.split('.')
    props.reverse()
    while props and root:
        prop = props.pop()
        root = access(root, prop, default=default)
    return root
1016173
function getKeyStrokeString(ev) {
    var keys = [];

    if (ev.ctrlKey || ev.metaKey) {
        keys.push('ctrl');
    }
    if (ev.shiftKey) {
        keys.push('shift');
    }
    keys.push(keyNameMap[ev.keyCode]);

    return keys.join('-');
}
40871
public String getString(Enum<?> key)
    {
        if (key == null)
        {
            return null;
        }

        return getString(key.name());
    }
70324
private char checkKey(Object key) {
	if (key == null) {
	    throw new NullPointerException("key cannot be null");
	} else if (!(key instanceof Character)) {
	    throw new IllegalArgumentException("key must be an Character");
	}
	else {
	    return ((Character)key).charValue();
	}
    }
1318776
public String getString(String key) {
    	String value = get(key);
    	Utils.require(value != null, key + " parameter is not set");
    	return value;
    }
860125
def _stringifyKeys(d):
    
    return dict((k.encode('ascii'), v)  for (k, v) in d.iteritems())
1085211
def _parse_key(key):
    '''
    
    '''
    splt = key.split("\\")
    hive = splt.pop(0)
    key = '\\'.join(splt)
    return hive, key
797819
function parseKeyString(str) {
      var key, match;
      var keys = [];
      while (str) {
        match = (/<\w+-.+?>|<\w+>|./).exec(str);
        if(match === null)break;
        key = match[0];
        str = str.substring(match.index + key.length);
        keys.push(key);
      }
      return keys;
    }
1076942
public char getChar(String key) {
        String s = getString(key);
        if (s == null || s.trim().length() == 0) {
            return (char) 0;
        } else {
            return s.charAt(0);
        }
    }
397442
function getKeys(key) {
    var keys;
    key = key.replace(/\s/g, '');
    keys = key.split(',');
    if ((keys[keys.length - 1]) == '') {
      keys[keys.length - 2] += ',';
    }
    return keys;
  }
561482
def get_key(self, key):
        
        return self.__mapping.get(self.type(key), self.__getitem__)(key)