Validate given hyper parameters with respect to type parameter P.

It verifies that given parameters are annotated in P with @API annotation

@param params      regular model build parameters
@param hyperParams map of hyper parameters
501846
protected void validateHyperParams(P params, Map<String, Object[]> hyperParams) {
    List<SchemaMetadata.FieldMetadata> fsMeta = SchemaMetadata.getFieldMetadata(params);
    for (Map.Entry<String, Object[]> hparam : hyperParams.entrySet()) {
      SchemaMetadata.FieldMetadata fieldMetadata = null;
      // Found corresponding metadata about the field
      for (SchemaMetadata.FieldMetadata fm : fsMeta) {
        if (fm.name.equals(hparam.getKey())) {
          fieldMetadata = fm;
          break;
        }
      }
      if (fieldMetadata == null) {
        throw new H2OIllegalArgumentException(hparam.getKey(), "grid",
                                              "Unknown hyper parameter for grid search!");
      }
      if (!fieldMetadata.is_gridable) {
        throw new H2OIllegalArgumentException(hparam.getKey(), "grid",
                                              "Illegal hyper parameter for grid search! The parameter '"
                                              + fieldMetadata.name + " is not gridable!");
      }
    }
  }
543511
def _validate_api_params(params):
    '''
    
    '''
    # page_id and API key are mandatory and they must be string/unicode
    return (isinstance(params['api_page_id'], (six.string_types, six.text_type)) and
            isinstance(params['api_key'], (six.string_types, six.text_type)))
105093
public static final ParseResult parseParams(Object[] params) {
		Tree data = null;
		CallOptions.Options opts = null;
		Groups groups = null;
		PacketStream stream = null;
		if (params != null) {
			if (params.length == 1) {
				if (params[0] instanceof Tree) {
					data = (Tree) params[0];
				} else if (params[0] instanceof CallOptions.Options) {
					opts = (CallOptions.Options) params[0];
				} else if (params[0] instanceof Groups) {
					groups = (Groups) params[0];
				} else if (params[0] instanceof PacketStream) {
					data = new Tree();
					stream = (PacketStream) params[0];
				} else {
					data = new CheckedTree(params[0]);
				}
			} else {
				LinkedHashMap<String, Object> map = new LinkedHashMap<>();
				String prev = null;
				Object value;
				for (int i = 0; i < params.length; i++) {
					value = params[i];
					if (prev == null) {
						if (!(value instanceof String)) {
							if (value instanceof CallOptions.Options) {
								opts = (CallOptions.Options) value;
								continue;
							}
							if (value instanceof Groups) {
								groups = (Groups) value;
								continue;
							}
							if (value instanceof PacketStream) {
								stream = (PacketStream) value;
								continue;
							}
							i++;
							throw new IllegalArgumentException("Parameter #" + i + " (\"" + value
									+ "\") must be String, Context, Groups, PacketStream or CallOptions!");
						}
						prev = (String) value;
						continue;
					}
					map.put(prev, value);
					prev = null;
				}
				data = new Tree(map);
			}
		}
		return new ParseResult(data, opts, groups, stream);
	}
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);
      }
    });
  }
361388
private static void validateParams(List<Object> params, Class<?> classz) {

        // skip validation if not uimafit
        if (!JCasAnnotator_ImplBase.class.isAssignableFrom(classz)
                && !JCasCollectionReader_ImplBase.class.isAssignableFrom(//
                        classz)) {
            LOG.warn(
                    "    +- Could not validate parameters in {}. You might want to check it manually.",
                    classz.getName());
            return;
        }

        for (int i = 0; i < params.size(); i = i + 2) {
            String paramName = (String) params.get(i);
            try {

                // add fields from superclass as well
                Set<Field> fields = newHashSet(classz.getDeclaredFields());
                fields.addAll(newHashSet(classz.getSuperclass()
                        .getDeclaredFields()));

                List<String> paramNames = new ArrayList<String>();
                for (Field f : fields) {
                    if (f.isAnnotationPresent(ConfigurationParameter.class)) {
                        ConfigurationParameter confParam = f
                                .getAnnotation(ConfigurationParameter.class);
                        paramNames.add(confParam.name());
                    }
                }

                if (!paramNames.contains(paramName)) {
                    LOG.warn(
                            "    +-XXXXXXXXX Could not find parameter '{}' in {}. You should check it.",
                            paramName, classz.getName());
                    LOG.warn("    +-XXXXXXXXX Available parameters are:\n",
                            join(paramNames, "\n"));
                }
            } catch (SecurityException e) {
                LOG.error(
                        "could not validate params for "
                                + classz.getSimpleName(), e);
            }
        }
    }
175562
protected function checkParams($params)
    {
        foreach ($params as $type) {
            if ($type instanceof Decorator) {
                $this->errors[] = "Parameter is not well instantiated [" . (string)$type . "]";
            }
        }
    }
1023760
public void setParamsToRuntimeCheck(Predicate<String> paramNames) {
    checkState(this.paramsToRuntimeTypeCheck == null);
    this.paramsToRuntimeTypeCheck = checkNotNull(paramNames);
  }
865067
@Override
    public void addParameterAnnotation(int param, AnnotationValue annotationValue) {
        HashMap<Integer, Map<ClassDescriptor, AnnotationValue>> updatedAnnotations = new HashMap<>(
                methodParameterAnnotations);
        Map<ClassDescriptor, AnnotationValue> paramMap = updatedAnnotations.get(param);
        if (paramMap == null) {
            paramMap = new HashMap<>();
            updatedAnnotations.put(param, paramMap);
        }
        paramMap.put(annotationValue.getAnnotationClass(), annotationValue);

        methodParameterAnnotations = updatedAnnotations;
        TypeQualifierApplications.updateAnnotations(this);
    }
786068
@Override
    public boolean parseParameters(Object params)
    {
        super.parseParameters(params);
        if (params == null || !(params instanceof RewardForStructureCopying))
            return false;

        this.rscparams = (RewardForStructureCopying) params;

        this.rewardDensity = rscparams.getRewardDensity();
        this.dimension = rscparams.getDimension();
        return true;
    }
827958
public void writeParameterSet(ParameterSet params) throws IOException {
        int len = params.getSerializedSize();
        growIfNeeded(len);
        params.flattenToBuffer(buffer.b());
    }
401148
public void setParams(java.util.Collection<UpdateParam> params) {
        if (params == null) {
            this.params = null;
            return;
        }

        this.params = new java.util.ArrayList<UpdateParam>(params);
    }
525148
private static void setParams(Map<String, ?> map) {
        for (String name : map.keySet()) {
            setParam(name, map.get(name));
        }
    }
1330455
@com.fasterxml.jackson.annotation.JsonProperty("invalidParameter")
    public void setInvalidParameter(String invalidParameter) {
        this.invalidParameter = invalidParameter;
    }
70607
public void setParameters(java.util.Collection<ParameterMetadata> parameters) {
        if (parameters == null) {
            this.parameters = null;
            return;
        }

        this.parameters = new com.amazonaws.internal.SdkInternalList<ParameterMetadata>(parameters);
    }
517449
protected function validateRequiredParameters(array $required, array $params)
    {
        foreach ($required as $param) {
            if (!isset($params[$param])) {
                throw new MissingArgumentException(sprintf('The "%s" parameter is required.', $param));
            }
        }
    }
1280079
public void validateParameters() {

        // localisation
        CmsMessages messages = Messages.get().getBundle(getLocale());

        StringBuffer validationErrors = new StringBuffer();
        if (CmsStringUtil.isEmpty(getParamResource())) {
            validationErrors.append(messages.key(Messages.GUI_ELEM_RENAME_VALIDATE_RESOURCE_FOLDER_0)).append("<br>");
        }
        if (CmsStringUtil.isEmpty(getParamTemplate())) {
            validationErrors.append(messages.key(Messages.GUI_ELEM_RENAME_VALIDATE_SELECT_TEMPLATE_0)).append("<br>");
        }
        if (CmsStringUtil.isEmpty(getParamLocale())) {
            validationErrors.append(messages.key(Messages.GUI_ELEM_RENAME_VALIDATE_SELECT_LANGUAGE_0)).append("<br>");
        }
        if (CmsStringUtil.isEmpty(getParamOldElement())) {
            validationErrors.append(messages.key(Messages.GUI_ELEM_RENAME_VALIDATE_ENTER_OLD_ELEM_0)).append("<br>");
        }
        if (CmsStringUtil.isEmpty(getParamNewElement())) {
            validationErrors.append(messages.key(Messages.GUI_ELEM_RENAME_VALIDATE_ENTER_NEW_ELEM_0)).append("<br>");
        }
        if (!isValidElement(getParamNewElement())) {
            validationErrors.append(
                messages.key(
                    Messages.GUI_ELEM_RENAME_VALIDATE_INVALID_NEW_ELEM_2,
                    getParamNewElement(),
                    getParamTemplate())).append("<br>");
        }

        setErrorMessage(validationErrors.toString());
    }
808905
private void verifyArguments(JmxExecRequest request, OperationAndParamType pTypes, int pNrParams, List<Object> pArgs) {
        if ( (pNrParams > 0 && pArgs == null) || (pArgs != null && pArgs.size() != pNrParams)) {
            throw new IllegalArgumentException("Invalid number of operation arguments. Operation " +
                    request.getOperation() + " on " + request.getObjectName() + " requires " + pTypes.paramClasses.length +
                    " parameters, not " + (pArgs == null ? 0 : pArgs.size()) + " as given");
        }
    }