Return the information if a mapping exists.

    :param kb_name: knowledge base name
    :param key: left side (mapFrom)
494619
def kb_mapping_exists(kb_name, key):
    
    try:
        kb = get_kb_by_name(kb_name)
    except NoResultFound:
        return False
    return key in kb.kbrvals
1115988
def get_data_by_key(self, name):
        
        data = graceful_chain_get(self.json, "data")

        if data is None or name not in data:
            return {}

        if self.is_yaml(name):
            return yaml.load(data[name]) or {}
        return json.loads(data[name])
208137
def check_key(self, key):
        """"""
        return _check_key(key, allow_unicode_keys=self.allow_unicode_keys,
                          key_prefix=self.key_prefix)
265467
def get_object_key(self, key, using_name=True):
        
        try:
            if using_name:
                return self.o_name[key].key
            else:
                return self.o[key].key
        except KeyError:
            raise ValueError("'%s' are not found!" % key)
26384
def get(self, key):
        '''
        
        '''
        if key in self._data_fields:
            return self._data_fields[key]
        if key in self._sub_reports:
            return self._sub_reports[key]
        return None
124279
def get_kbr_keys(kb_name, searchkey="", searchvalue="", searchtype='s'):
    
    if searchtype == 's' and searchkey:
        searchkey = '%'+searchkey+'%'
    if searchtype == 's' and searchvalue:
        searchvalue = '%'+searchvalue+'%'
    if searchtype == 'sw' and searchvalue:  # startswith
        searchvalue = searchvalue+'%'
    if not searchvalue:
        searchvalue = '%'
    if not searchkey:
        searchkey = '%'

    query = db.session.query(models.KnwKBRVAL).join(models.KnwKB) \
        .filter(models.KnwKBRVAL.m_key.like(searchkey),
                models.KnwKBRVAL.m_value.like(searchvalue),
                models.KnwKB.name.like(kb_name))

    return [(k.m_key,) for k in query.all()]
797759
def fetch_key(key)
      string_key = key.to_s
      keys.detect { |k| k.to_s.casecmp(string_key) == 0 }
    end
845060
def _check_key(self, key):
        
        self.setup_schema()
        if key not in self._attrs and key not in self:
            raise KeyError(key)
446016
def _map_name(self, name, mapper):
        
        if mapper is not None:
            if isinstance(mapper, basestring):
                name = mapper + name
            try:
                name = mapper[name]
            except KeyError:
                pass
        return name
958398
def cache_key_name(cls, *args):
        """"""
        if cls.KEY_FIELDS != ():
            if len(args) != len(cls.KEY_FIELDS):
                raise TypeError(
                    "cache_key_name() takes exactly {} arguments ({} given)".format(len(cls.KEY_FIELDS), len(args))
                )
            # pylint: disable=unicode-builtin
            return 'configuration/{}/current/{}'.format(cls.__name__, ','.join(six.text_type(arg) for arg in args))
        else:
            return 'configuration/{}/current'.format(cls.__name__)
840316
def _get_tk_config(self, key, default=False):
        
        if default:
            return self._tk_defaults[key]
        else:
            return self.tk[key]
1205662
def key(self, key=""):
    
    params = join_params(self.parameters, {"key": key})

    return self.__class__(**params)
910659
def map_size(self, key):
        
        # TODO: This should use get_count, but we need to check for compat
        # with server version (i.e. >= 4.6) first; otherwise it just
        # disconnects.

        rv = self.get(key)
        return len(rv.value)
1185548
def exists(self, name):
        
        with self.pipe as pipe:
            return pipe.exists(self.redis_key(name))
712083
def has_key(self, key):
        """"""
        k = self._lowerOrReturn(key)
        return k in self.data
1094098
private boolean containsKey(K key, int keyGroupIndex, N namespace) {

		checkKeyNamespacePreconditions(key, namespace);

		Map<N, Map<K, S>> namespaceMap = getMapForKeyGroup(keyGroupIndex);

		if (namespaceMap == null) {
			return false;
		}

		Map<K, S> keyedMap = namespaceMap.get(namespace);

		return keyedMap != null && keyedMap.containsKey(key);
	}
1278166
def _check_key(self, key):
        
        if not len(key) == 2:
            raise TypeError('invalid key: %r' % key)
        elif key[1] not in TYPES:
            raise TypeError('invalid datatype: %s' % key[1])