Given a dict of hyperparameter settings, throw an exception if any
        keys are not defined in this HyperparameterDefaults instance.
169545
def check_valid_keys(self, obj):
        
        invalid_keys = [
            x for x in obj if x not in self.defaults
        ]
        if invalid_keys:
            raise ValueError(
                "No such model parameters: %s. Valid parameters are: %s"
                % (" ".join(invalid_keys),
                    " ".join(self.defaults)))
1163902
def from_dict(settings):
    

    assert isinstance(settings, dict), "`settings` must be of type dict"
    for key, value in settings.items():
        setattr(self, key, value)
190639
private void checkDefaults() {
        Utils.require(m_shards != null || m_shardsRange != null, "shards or range parameter is not set");
        Utils.require(m_shards == null || m_shardsRange == null, "shards and range parameters cannot be both set");
        
        Utils.require(m_xshards == null || m_xshardsRange == null, "xshards and xrange parameters cannot be both set");
        if(m_xshards == null && m_xshardsRange == null) {
        	m_xshards = m_shards;
        	m_xshardsRange = m_shardsRange;
        }
        
        if (m_query == null) m_query = "*";
        if(m_metrics == null) m_metrics = "COUNT(*)";
    }
445865
function checkParams(params, reqParams) {
    if ( reqParams.length < 1 ) {
      return;
    }

    if ( (_.isEmpty(params) || !params) && (reqParams.length > 0) ) {
      throw new Error('Missing parameters: ' + reqParams.join(', '));
    }

    var paramsKeys = _.keys(params);
  
    _.each(reqParams, function(reqParam) {
      if ( paramsKeys.indexOf(reqParam) === -1 ) {
        throw new Error('Missing parameter: ' + reqParam);
      }
    });
  }
1011583
def _setDefault(self, **kwargs):
        
        for param, value in kwargs.items():
            p = getattr(self, param)
            if value is not None and not isinstance(value, JavaObject):
                try:
                    value = p.typeConverter(value)
                except TypeError as e:
                    raise TypeError('Invalid default param value given for param "%s". %s'
                                    % (p.name, e))
            self._defaultParamMap[p] = value
        return self
352980
def validate_key(self, key):
        
        if not key:
            name = self.__class__.__name__
            msg = "%s response missing %s" % (name, self.key_name)
            raise ValidationException(msg, self)
        elif not isinstance(key, str):
            msg = "Response contains invalid %s type" % self.key_name
            raise ValidationException(msg, type(key))
685668
def setParameter(self, parameterName, index, parameterValue):
    
    spec = self.getSpec()
    if parameterName not in spec['parameters']:
      raise Exception("Unknown parameter: " + parameterName)

    setattr(self, parameterName, parameterValue)
514955
public static void checkKeys(JSONObject o, String... keys) throws JSONConverterException {
        for (String k : keys) {
            if (!o.containsKey(k)) {
                throw new JSONConverterException("Missing key '" + k + "'");
            }
        }
    }
604901
def _ignore_keys(endpoint_props):
    '''
    
    '''
    return dict(
        (prop_name, prop_val)
        for prop_name, prop_val in six.iteritems(endpoint_props)
        if prop_name not in _DO_NOT_COMPARE_FIELDS
    )
1246592
def _validate_key(self, key):
        """"""
        return not any([key.startswith(i) for i in self.EXCEPTIONS])
679299
def setdefault(self, key, defaultvalue = None):
        
        (t, k) = self._getsubitem(key, True)
        return t.__dict__.setdefault(k, defaultvalue)
287816
def value(self, key, default=None):
        
        if self._customFormat:
            return self._customFormat.value(key, default)
        else:
            return unwrapVariant(super(XSettings, self).value(key))
475751
function missingParamError () {
	var params = new Parameterizer (null, null);
	params.get = function (key) {
		throw new Error ('missing param ' + key);
	};
	return params;
}
185303
def map_exceptions(self, mapping, *args, **kwargs):
        
        @self.__call__(*args, **kwargs)
        def helper(e, status):
            return dict(exception=e), status

        def wrap(target):
            @wraps(target)
            def wrapper(*args, **kwargs):
                try:
                    return target(*args, **kwargs)
                except BaseException as e:
                    for klass, status in mapping:
                        if isinstance(e, klass):
                            return helper(e, status)
                    raise
            return wrapper
        return wrap
1088164
def get_setting(key, **kwargs):
    
    has_default = 'default' in kwargs
    default_val = kwargs.get('default')

    try:
        if has_default:
            return getattr(settings, key, default_val)
        else:
            return getattr(settings, key)
    except Exception as e:
        raise ImproperlyConfigured(
            _('"{0}" setting has not been properly set. {1}').format(key, e)
        )
861617
protected static void validateParamsPresence(Map params, String... keys) {
        for (String name : keys) {
            if (!params.containsKey(name)) {
                throw new IllegalArgumentException("parameter: '" + name + "' is missing");
            }
        }
    }
845060
def _check_key(self, key):
        
        self.setup_schema()
        if key not in self._attrs and key not in self:
            raise KeyError(key)