Return the kind specified by a given __property__ key.

    Args:
      key: key whose kind name is requested.

    Returns:
      The kind specified by key.
4
def key_to_kind(cls, key):
    
    if key.kind() == Kind.KIND_NAME:
      return key.id()
    else:
      return key.parent().id()
879369
public String type(Object key) {
		Jedis jedis = getJedis();
		try {
			return jedis.type(keyToBytes(key));
		}
		finally {close(jedis);}
	}
352980
def validate_key(self, key):
        
        if not key:
            name = self.__class__.__name__
            msg = "%s response missing %s" % (name, self.key_name)
            raise ValidationException(msg, self)
        elif not isinstance(key, str):
            msg = "Response contains invalid %s type" % self.key_name
            raise ValidationException(msg, type(key))
1210097
def key_type(key, host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.type(key)
710788
protected <T> T getProperty(String key, Class<T> type) {
        Object returnValue = getProperty(key);
        if (returnValue != null) {
            return (T) returnValue;
        } else {
            return null;
        }
    }
859241
def _real_key(self, key):
        
        if key is not None:
            try:
                return key.lower()
            except AttributeError:
                raise TypeError(
                    _format("NocaseDict key {0!A} must be a string, "
                            "but is {1}", key, type(key)))

        if self.allow_unnamed_keys:
            return None

        raise TypeError(
            _format("NocaseDict key None (unnamed key) is not "
                    "allowed for this object"))
371642
def get_index(self, key):
        
        try:
            return self[self.index_lookup.get(key)]

        except TypeError:
            raise KeyError
735472
def get(self, key):
        
        keystr = str(key)
        res = None

        try:
            res = self.ctx[keystr]
        except KeyError:
            for k, v in self.ctx.items():
                if "name" in v and v["name"].lower() == keystr.lower():
                    res = v
                    break

        return res
137085
def get(self, key, default=None):
        
        try:
            val = self
            if "." not in key:
                return self[key]
            for k in key.split('.'):
                if k.isdigit():
                    k = int(k)
                val = val[k]
            return val
        except (TypeError, KeyError, IndexError) as e:
            return default
51464
def get(self, key, default=None):
        
        try:
            result = self._loads(self._client.hget(self.key_prefix, key))
            assert result is not None
            return result
        except (AssertionError, KeyError):
            return default or self._default
1028545
public String getKeyType(UniqueKeyDefinition key){
        String tType;

        List<ColumnDefinition> keyColumns = key.getKeyColumns();

        if (keyColumns.size() == 1) {
            tType = getJavaType(keyColumns.get(0).getType());
        }
        else if (keyColumns.size() <= Constants.MAX_ROW_DEGREE) {
            String generics = "";
            String separator = "";

            for (ColumnDefinition column : keyColumns) {
                generics += separator + (getJavaType(column.getType()));
                separator = ", ";
            }

            tType = Record.class.getName() + keyColumns.size() + "<" + generics + ">";
        }
        else {
            tType = Record.class.getName();
        }

        return tType;
    }
744685
def get(self, key):
        

        match = self._get_match(key=key)

        if not match:
            return None

        return self._get_value_from_match(key=key, match=match)
1136445
private <T> T getTyped(PropertyKey key, Class<T> clazz) {
        Property p = getProperty(key.m_key);
        
        if (null == p || null == p.getData()) {
            return clazz.cast(m_defaults.get(key));
        }

        return clazz.cast(p.getData());
    }
519362
function( key ) {
			//check if it is described directly
			if ( S.key.browser[key] ) {
				return S.key.browser[key];
			}
			for ( var kind in S.key.kinds ) {
				if ( h.inArray(key, S.key.kinds[kind]) > -1 ) {
					return S.key.browser[kind]
				}
			}
			return S.key.browser.character
		}
263972
def from_key(key):
    
    model = get_model_from_key(key)
    if model is None:
        raise BadKeyError
    try:
        _, id = key.split(':', 2)
        id = int(id)
    except ValueError, TypeError:
        raise BadKeyError
    return model.objects.get_by_id(id)
587140
def get(self, key, default=None):
        
        try:
            return self[key]
        except KeyError:
            return default or self._default
65861
def for_kind(kind_map, type_, fallback_key):
        
        if type_ not in kind_map:
            if fallback_key not in kind_map:
                raise ConfigException('"%s" is not in the config and has no fallback' % type_)

            config = kind_map[fallback_key]
        else:
            config = kind_map[type_]

        if isinstance(config, dict):
            if 'element' not in config:
                raise ConfigException('"%s" does not define an element' % type_)

            opts = Options(type_, **config)
        else:
            opts = Options(type_, config)

        return opts