Specifies keys that must exist
10917
def require(*keys)
      permitted_keys.merge keys
      required_keys = keys.to_set
      unless (missing_keys = required_keys - hash_keys).empty?
        error "required #{terms} #{missing_keys.to_a} missing" + postscript
      end
      self
    end
1224061
def key?(key)
      configuration.key?(key.to_sym) || config_contexts.key?(key.to_sym)
    end
849589
def have_key(self, *keygrips):
        """"""
        for keygrip in keygrips:
            try:
                self.get_identity(keygrip=keygrip)
                break
            except KeyError as e:
                log.warning('HAVEKEY(%s) failed: %s', keygrip, e)
        else:
            raise AgentError(b'ERR 67108881 No secret key <GPG Agent>')
763988
function has($key)
    {
        $key = $this->_normalizeKey($key);
        return array_key_exists($key, $this->_referDataArrayReference());
    }
11638
def key_exists(self, key):
        
        assert isinstance(key, str)
        self._close()
        try:
            return self._unsafe_key_exists(key)
        finally:
            self._open()
530630
def configure_keys(self):
        """"""
        self.active_functions = set()
        self.key2func = {}
        for funcname, key in self.key_map.items():
            self.key2func[key] = getattr(self, funcname)
270142
public boolean exists(Object key) {
		for (Scope cur=this; cur!=null; cur=cur.parent) {
			if (cur.data != null && cur.data.containsKey(key)) {
				return true;
			}
		}
		return false;
	}
822204
function setKey(key, val, flag, expiry, xflag, req) {
  var exists = this._data[key] !== undefined;
  var o = {v: val, t: Date.now()};
  if((xflag === Constants.NX && exists)
    || (xflag === Constants.XX && !exists)) {
    return undefined;
  }
  this._data[key] = o;
  if(!exists) {
    this._keys.push(key);
  }
  if((flag === Constants.EX || flag === Constants.PX)
    && expiry !== undefined) {
    expiry = flag === Constants.EX
      ? Date.now() + (expiry * 1000)
      : Date.now() + expiry;
    this.setExpiry(key, expiry, req);
  }
  return Constants.OK;
}
365045
def suitability_as_key(self, key_name):
        
        pk_values = all_values_for(self, key_name)
        if not pk_values:
            return ('absent', int)  # could still use it
        key_type = type(th.best_coercable(pk_values))
        num_unique_values = len(set(pk_values))
        if num_unique_values < len(pk_values):
            return (False, None)     # non-unique
        if num_unique_values == len(self):
            return (True, key_type)  # perfect!
        return ('partial', key_type)
951117
function setKey(key, val, ex, px, flag, req) {
  var saved = HashMap.prototype.setKey.apply(this, arguments);
  if(req && req.def) {
    this.modified(req);
  }
  return saved;
}
189567
function hasKey(key) {
    return data.meta[key] !== undefined
      && (self.lookup[key] === null ||
      self.lookup[key] === data.meta[key]);
  }
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
927130
def _ensure_field(self, key):
        """"""
        if self._has_field:
            self._size += 2  # comma, space
        self._has_field = True

        self._size += len(key) + 4
689221
def assert_valid_keys(options, valid_options)
      unknown_keys = options.keys - valid_options.keys
      raise(ArgumentError, "Unknown options(s): #{unknown_keys.join(", ")}") unless unknown_keys.empty?
    end
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
921578
def _validate_other_keys(optional, types, missing, validated, data,
                         to_validate):
    """"""
    errors = []
    for key in to_validate:
        value = data[key]
        if key in optional:
            errors.extend(
                _validate_optional_key(
                    key, missing, value, validated, optional))
            continue
        errors.extend(_validate_type_key(key, value, types, validated))
    return errors
871644
def key(*keys)
      options = keys.extract_options!
      raise ArgumentError.new("has_settings: Option :defaults expected, but got #{options.keys.join(', ')}") unless options.blank? || (options.keys == [:defaults])
      keys.each do |key_name|
        unless key_name.is_a?(Symbol) || key_name.is_a?(String)
          raise ArgumentError.new("has_settings: symbol or string expected, but got a #{key_name.class}")
        end
      end

      options[:defaults].each do |k, v|
        has_settings(*keys).attr(k, default: v)
      end
    end