Checks if the specified item exists.

    Args:
      key: the key of the item to lookup.
    Returns:
      True if the item exists; False otherwise.
    Raises:
      Exception if there was an error requesting information about the item.
978023
def contains(self, key):
    
    try:
      self._api.objects_get(self._bucket, key)
    except datalab.utils.RequestException as e:
      if e.status == 404:
        return False
      raise e
    except Exception as e:
      raise e
    return True
60271
def exists(self, callback=None):
        
        def existence_tested(response):
            if callable(callback):
                callback(bool(response))
        self.bucket.lookup(self.name, callback=existence_tested)
1288897
def hexists(self, key):
        
        try:
            hashkey = self.key
        except DoesNotExist:
            """
            If the object doesn't exists anymore, its PK is deleted, so the
            "self.key" call will raise a DoesNotExist exception. We catch it
            to return False, as the field doesn't exists too.
            """
            return False
        else:
            return self.connection.hexists(hashkey, key)
1276946
def key_exists(self, namespace, key):
        

        return namespace in self.__data and key in self.__data[namespace]
561482
def get_key(self, key):
        
        return self.__mapping.get(self.type(key), self.__getitem__)(key)
1075138
def has(self, key, mtime=None):
        
        v = self.__values.get(key, None)
        if not v:
            return False
        if self.check_modified_time:
            mtime = self._get_mtime(key, mtime)
            if mtime != self.__modified_times[key]:
                del self[key]
                return False
        return True
596049
def has_key?(key)
      node = self

      while node do
        # Find index of the entry that best fits the key.
        i = node.search_key_index(key)
        if node.is_leaf?
          # This is a leaf node. Check if there is an exact match for the
          # given key and return the corresponding value or nil.
          return node.keys[i] == key
        end

        # Descend into the right child node to continue the search.
        node = node.children[i]
      end

      PEROBS.log.fatal "Could not find proper node to get from while " +
        "looking for key #{key}"
    end
390969
def exists(self, pattern, **match_kwargs):
        
        ret = self.match(pattern, **match_kwargs)
        if ret is None:
            return None
        if not ret.matched:
            return None
        return ret
456671
def key_exists(self, key, secret=False):
        '''
        
        '''
        if len(key) < 8:
            return False
        key = key.upper()
        res = self.list_keys(secret)
        for fingerprint in res.keys:
            if fingerprint.endswith(key):
                return True
        return False
655370
def check_key(self, key: str) -> bool:
        
        keys = self.get_keys()
        return key in keys
419543
def get(self, key, default=None):
        
        try:
            index = self.__keys.index(str(key))
        except ValueError:
            return default
        if 0 <= index < len(self):
            return super(Record, self).__getitem__(index)
        else:
            return default
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])
1303116
def index(self, key):
        
        if isinstance(key, int):
            if 0 <= key < len(self.__keys):
                return key
            raise IndexError(key)
        elif isinstance(key, str):
            try:
                return self.__keys.index(key)
            except ValueError:
                raise KeyError(key)
        else:
            raise TypeError(key)
1302219
def _check_object_exists(self):
        
        if not DB.get_keys(self.key):
            raise KeyError("Object with key '{}' not exist".format(self.key))
712083
def has_key(self, key):
        """"""
        k = self._lowerOrReturn(key)
        return k in self.data
925982
def _has(self, key, exact=0):

        """"""

        if not exact:
            try:
                key = self.getfullkey(key)
                return 1
            except KeyError:
                return 0
        else:
            return key in self.data
554174
private boolean checkIfKeyExists(String key)
    {
        if (aggregationsKeySet == null)
        {
            aggregationsKeySet = new HashSet<String>();
        }
        return aggregationsKeySet.add(key);
    }