Checks if a required key is present in provided datas.
 @param [Object] key the key of which check the presence.
 @raise [ArgumentError] if the key is not present.
320180
def required(key)
      raise_error(type: "required", key: key) unless validator.datas.has_key?(key)
    end
972765
protected function checkKeyExists($data, $key)
    {
        if (!$data->has($key)) {
            $this->output->writeln("<error>The key $key does not exist.");

            return false;
        }

        return true;
    }
554174
private boolean checkIfKeyExists(String key)
    {
        if (aggregationsKeySet == null)
        {
            aggregationsKeySet = new HashSet<String>();
        }
        return aggregationsKeySet.add(key);
    }
1198137
def validate_keys(*valid_keys)
      valid_keys.flatten!
      @hash.each_key do |k|
        unless valid_keys.include?(k)
          raise ArgumentError.new("Unknown key: #{k.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(', ')}")
        end
      end
    end
1017302
def assert_valid_key_size(key)
      expected_key_size = self.key(repository_name).size
      actual_key_size   = key.size

      if actual_key_size != expected_key_size
        raise ArgumentError, "The number of arguments for the key is invalid, expected #{expected_key_size} but was #{actual_key_size}"
      end
    end
936166
def check_key!(key)
      return if key.is_a?(String) || key.is_a?(Symbol)
      raise TypeError, 'key must be a String or Symbol'
    end
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);
			}
		}
	}
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;
	}
1108440
private void verifyKey(final String key) {

		if (!theKey.get().equals(key)) {
			try {
				throw new RuntimeException("Must have same key for Redis Pipeline in Dynomite. This key: " + key);
			} finally {
				discardPipelineAndReleaseConnection();
			}
		}
	}
797543
def check_key(key, allowed):
    

    if key in allowed:
        return True

    for pattern in allowed:
        if fnmatch(key, pattern):
            return True

    return False
680589
def make_key
      if options.key? :method
        options[:method].to_sym
      elsif options.include?(:controller) && options.include?(:action)
        "#{options[:controller]}_#{options[:action]}".to_sym
      else
        raise(ArgumentError,
              'Options should contain :controller and :action or :method.')
      end
    end
1276946
def key_exists(self, namespace, key):
        

        return namespace in self.__data and key in self.__data[namespace]
1338512
def require_program(*keys)
      keys.each do |key|
        fail CommandError, "program #{key} required" if program(key).nil? || program(key).empty?
      end
    end
319064
def exists(self, key, fresh=False):
        
        key = key.upper()
        if key in self._deleted:
            return False
        return self.get(key, fresh=fresh, default=missing) is not missing
482944
def key_exists(self, key):
        
        assert isinstance(key, str)
        cursor = self.conn.cursor()
        with contextlib.closing(cursor):
            cursor.execute('SELECT COUNT(*) FROM events WHERE uuid=?', (key,))
            res = cursor.fetchone()
            count = res[0]
        if count == 0:
            return False
        else:
            assert count in (0, 1), \
                "Duplicate event ids detected: {0}".format(count)
            return True
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
11638
def key_exists(self, key):
        
        assert isinstance(key, str)
        self._close()
        try:
            return self._unsafe_key_exists(key)
        finally:
            self._open()