/*
Check that a key exists
322528
function(key) {
            var s = Storage.storage();
            if (s == null) {
                return false;
            }
            return _.isUndefined(s[key]) == false;
        }
221107
private boolean propertyExists(String key) {
        String value = getProperty(key);
        return (null != value && 0 < value.length());
    }
1179302
@Override
  public Long exists(final byte[]... keys) {
    checkIsInMultiOrPipeline();
    client.exists(keys);
    return client.getIntegerReply();
  }
268748
static public function exists($key)
    {
        $keyMD5 = md5(self::$keyPrefix . serialize($key));
        $dir = self::getLocksDir();
        if (!is_dir($dir)) {
            return false;
        }
        $filename = $dir . $keyMD5 . '.lock';
        set_error_handler(function($errno, $errstr) {
            throw new \Exception($errstr);
        });
        try {
            $filePointer = fopen($filename, "w");
            if ($filePointer !== false) {
                $wouldBlock = null;
                if (flock($filePointer, LOCK_EX | LOCK_NB, $wouldBlock)) {
                    restore_error_handler();
                    return false;
                } else {
                    restore_error_handler();
                    return $wouldBlock === 1;
                }
            }
        } catch (\Exception $e) {
            
        }
        restore_error_handler();
        throw new \Exception('Cannot check if lock named "' . $key . '" exists.');
    }
526071
def exists(self, key):
    
    if key in self._keystore and not self._keystore[key].is_expired:
      return True
    elif key in self._keystore and self._keystore[key].is_expired:
      self.delete(key)
      return False

    return False
26886
private void checkKey(final byte[] key) {
		if (theBinaryKey.get() != null) {
			verifyKey(key);
		} else {
			boolean success = theBinaryKey.compareAndSet(null, key);
			if (!success) {
				// someone already beat us to it. that's fine, just verify
				// that the key is the same
				verifyKey(key);
			} else {
				pipelined(key);
			}
		}
	}
353640
public function exists($key) {
        if (!array_key_exists($key, $this->storage))
            return false;

        if ($this->storage[$key]['expires'] > 0 && time() > $this->storage[$key]['expires'])
            return false;

        return true;
    }
208137
def check_key(self, key):
        """"""
        return _check_key(key, allow_unicode_keys=self.allow_unicode_keys,
                          key_prefix=self.key_prefix)
1056776
public boolean containsKey(final Object key)
    {
        @DoNotSub final int mask = values.length - 1;
        @DoNotSub int index = Hashing.hash(key, mask);

        boolean found = false;
        while (missingValue != values[index])
        {
            if (key.equals(keys[index]))
            {
                found = true;
                break;
            }

            index = ++index & mask;
        }

        return found;
    }
917879
function exists($key,&$val=NULL) {
		$fw=Base::instance();
		if (!$this->dsn)
			return FALSE;
		$ndx=$this->prefix.'.'.$key;
		$parts=explode('=',$this->dsn,2);
		switch ($parts[0]) {
			case 'apc':
			case 'apcu':
				$raw=call_user_func($parts[0].'_fetch',$ndx);
				break;
			case 'redis':
				$raw=$this->ref->get($ndx);
				break;
			case 'memcache':
				$raw=memcache_get($this->ref,$ndx);
				break;
			case 'memcached':
				$raw=$this->ref->get($ndx);
				break;
			case 'wincache':
				$raw=wincache_ucache_get($ndx);
				break;
			case 'xcache':
				$raw=xcache_get($ndx);
				break;
			case 'folder':
				$raw=$fw->read($parts[1].$ndx);
				break;
		}
		if (!empty($raw)) {
			list($val,$time,$ttl)=(array)$fw->unserialize($raw);
			if ($ttl===0 || $time+$ttl>microtime(TRUE))
				return [$time,$ttl];
			$val=null;
			$this->clear($key);
		}
		return FALSE;
	}
954766
def has_key(self, key):
        """"""
        try:
            if type(self.attrs) == dict:
                return key in self.attrs
            else:
                raise AttributeError    # if attrs is not a dict
        except AttributeError:          # if attrs doesnt exist
            raise NotImplementedError
47384
def check_exists(required, input)
      required.inject(true) do |result, key|
        input[key] && result
      end
    end
258378
public function exists($key)
	{
		$key = $this->normalizeKey($key);

		return array_key_exists($key, $this->items);
	}
1213920
def _exists(self, key):
        
        filecache, keycache = self._fileslist()
        msg = keycache.get(key, None)
        if msg:
            path = msg.filename
            meta = filecache[path]
            return path, meta["hostname"], meta.get("flags", "")
        raise KeyError("not found %s" % key)
72117
function has(key) {
                                if (!isObject(key)) return false;
                                var data = getWeak(key);
                                if (data === true) return uncaughtFrozenStore(this).has(key);
                                return data && $has(data, this._i);
                            }
24812
public function exists($key)
    {
        $path = $this->computePath($key);

        return $this->fileSystem->exists($path);
    }
225492
def has_key(self, key):
        
        if key in self._dict:
            try: 
                self[key]
                return True
            except ValueError:
                return False
            except KeyError:
                return False
        return False