Validate common parameters for an iter... operation.

    MaxObjectCount must be a positive non-zero integer or None.

    OperationTimeout must be positive integer or zero

    Raises:

      ValueError: if these parameters are invalid
962566
def _validateIterCommonParams(MaxObjectCount, OperationTimeout):
    
    if MaxObjectCount is None or MaxObjectCount <= 0:
        raise ValueError(
            _format("MaxObjectCount must be > 0 but is {0}", MaxObjectCount))

    if OperationTimeout is not None and OperationTimeout < 0:
        raise ValueError(
            _format("OperationTimeout must be >= 0 but is {0}",
                    OperationTimeout))
612247
public static Timeout max(Timeout... timeouts)
	{
		Timeout max = null;

		for (Timeout timeout : timeouts)
		{
			if (timeout != null)
				if (max == null || max.getMilliseconds() < timeout.getMilliseconds())
					max = timeout;
		}

		if (max != null)
			return max;
		else
			throw new IllegalArgumentException("Must specify at least one non-null timeout!");
	}
1129267
def validate(cls, mapper_spec):
    
    if mapper_spec.input_reader_class() != cls:
      raise BadReaderParamsError("Input reader class mismatch")
    params = _get_params(mapper_spec)
    if cls.BATCH_SIZE_PARAM in params:
      try:
        batch_size = int(params[cls.BATCH_SIZE_PARAM])
        if batch_size < 1:
          raise BadReaderParamsError("Bad batch size: %s" % batch_size)
      except ValueError, e:
        raise BadReaderParamsError("Bad batch size: %s" % e)
119775
def validate_timeout_or_zero(option, value):
    
    if value is None:
        raise ConfigurationError("%s cannot be None" % (option, ))
    if value == 0 or value == "0":
        return 0
    return validate_positive_float(option, value) / 1000.0
1205385
def validate(self):
        
        super(NumericFilterBase, self).validate()

        self.not_null = False

        if self._value.startswith('+'):
            self._cmp = operator.gt
            self._rt_cmp = 'greater'
            self._value = self._value[1:]
        elif self._value.startswith('-'):
            self._cmp = operator.lt
            self._rt_cmp = 'less'
            self._value = self._value[1:]
        else:
            self._cmp = operator.eq
            self._rt_cmp = 'equal'
596859
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSInt timeout_validator = new MPSInt();
		timeout_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 0);
		timeout_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 18000);
		timeout_validator.validate(operationType, timeout, "\"timeout\"");
		
		MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
		ns_ip_address_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
		
	}
361794
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString bay_number_validator = new MPSString();
		bay_number_validator.validate(operationType, bay_number, "\"bay_number\"");
		
		MPSString name_validator = new MPSString();
		name_validator.validate(operationType, name, "\"name\"");
		
		MPSDoubleLong utilized_validator = new MPSDoubleLong();
		utilized_validator.validate(operationType, utilized, "\"utilized\"");
		
		MPSDoubleLong size_validator = new MPSDoubleLong();
		size_validator.validate(operationType, size, "\"size\"");
		
		MPSString status_validator = new MPSString();
		status_validator.validate(operationType, status, "\"status\"");
		
		MPSIPAddress host_ip_address_validator = new MPSIPAddress();
		host_ip_address_validator.validate(operationType, host_ip_address, "\"host_ip_address\"");
		
		MPSString act_id_validator = new MPSString();
		act_id_validator.validate(operationType, act_id, "\"act_id\"");
		
	}
1059004
def _validate(self, obj):
        
        report = ValidationReport()
        if not self.validator.is_valid(obj):
            for v in self.validator.iter_errors(obj):
                report.add_error("[%s] %s" % ('.'.join(str(vv) for vv in v.path), v.message))
        return report
462295
def _validate(self, val):
        
        if not self.check_on_set:
            self._ensure_value_is_in_objects(val)
            return

        if not (val in self.objects or (self.allow_None and val is None)):
            # CEBALERT: can be called before __init__ has called
            # super's __init__, i.e. before attrib_name has been set.
            try:
                attrib_name = self.name
            except AttributeError:
                attrib_name = ""

            items = []
            limiter = ']'
            length = 0
            for item in self.objects:
                string = str(item)
                length += len(string)
                if length < 200:
                    items.append(string)
                else:
                    limiter = ', ...]'
                    break
            items = '[' + ', '.join(items) + limiter
            raise ValueError("%s not in Parameter %s's list of possible objects, "
                             "valid options include %s"%(val,attrib_name, items))
152104
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString id_validator = new MPSString();
		id_validator.validate(operationType, id, "\"id\"");
		
		MPSInt adapter_id_validator = new MPSInt();
		adapter_id_validator.validate(operationType, adapter_id, "\"adapter_id\"");
		
		MPSInt enclosure_validator = new MPSInt();
		enclosure_validator.validate(operationType, enclosure, "\"enclosure\"");
		
		MPSInt slot_validator = new MPSInt();
		slot_validator.validate(operationType, slot, "\"slot\"");
		
		MPSInt deviceid_validator = new MPSInt();
		deviceid_validator.validate(operationType, deviceid, "\"deviceid\"");
		
		MPSString wwn_validator = new MPSString();
		wwn_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		wwn_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		wwn_validator.validate(operationType, wwn, "\"wwn\"");
		
		MPSString mec_validator = new MPSString();
		mec_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		mec_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		mec_validator.validate(operationType, mec, "\"mec\"");
		
		MPSString oec_validator = new MPSString();
		oec_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		oec_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		oec_validator.validate(operationType, oec, "\"oec\"");
		
		MPSString size_validator = new MPSString();
		size_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		size_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		size_validator.validate(operationType, size, "\"size\"");
		
		MPSString firmwarestate_validator = new MPSString();
		firmwarestate_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		firmwarestate_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		firmwarestate_validator.validate(operationType, firmwarestate, "\"firmwarestate\"");
		
		MPSString foreignstate_validator = new MPSString();
		foreignstate_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		foreignstate_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		foreignstate_validator.validate(operationType, foreignstate, "\"foreignstate\"");
		
		MPSString mediatype_validator = new MPSString();
		mediatype_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		mediatype_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		mediatype_validator.validate(operationType, mediatype, "\"mediatype\"");
		
		MPSString inquiry_validator = new MPSString();
		inquiry_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		inquiry_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		inquiry_validator.validate(operationType, inquiry, "\"inquiry\"");
		
		MPSIPAddress host_ip_address_validator = new MPSIPAddress();
		host_ip_address_validator.validate(operationType, host_ip_address, "\"host_ip_address\"");
		
		MPSBoolean is_used_validator = new MPSBoolean();
		is_used_validator.validate(operationType, is_used, "\"is_used\"");
		
		MPSString logical_disk_name_validator = new MPSString();
		logical_disk_name_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		logical_disk_name_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		logical_disk_name_validator.validate(operationType, logical_disk_name, "\"logical_disk_name\"");
		
		MPSInt ld_number_validator = new MPSInt();
		ld_number_validator.validate(operationType, ld_number, "\"ld_number\"");
		
		MPSInt disk_index_validator = new MPSInt();
		disk_index_validator.validate(operationType, disk_index, "\"disk_index\"");
		
	}
763769
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString policy_name_validator = new MPSString();
		policy_name_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		policy_name_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		policy_name_validator.validate(operationType, policy_name, "\"policy_name\"");
		
		MPSInt backup_to_retain_validator = new MPSInt();
		backup_to_retain_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 1);
		backup_to_retain_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 30);
		backup_to_retain_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		backup_to_retain_validator.validate(operationType, backup_to_retain, "\"backup_to_retain\"");
		
	}
1203526
def action_timeout=(t)
      t = t.to_f
      raise ArgumentError.new('Value must be greater than zero or nil') unless t >= 0
      @action_timeout = t
      @threads.each{|thread|thread.action_timeout = t}
      t
    end
354220
def validate(self, obj):
        

        if not isinstance(obj, self.model_class):
            raise ValidationError('Invalid object(%s) for service %s' % (type(obj), type(self)))
        LOG.debug(u'Object %s state: %s', self.model_class, obj.__dict__)
        obj.full_clean()
1111910
def fail(self, reason, obj, pointer=None):
        
        pointer = pointer_join(pointer)
        err = ValidationError(reason, obj, pointer)
        if self.fail_fast:
            raise err
        else:
            self.errors.append(err)
        return err
1333870
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString id_validator = new MPSString();
		id_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);
		id_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		id_validator.validate(operationType, id, "\"id\"");
		
		MPSString category_validator = new MPSString();
		category_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 1024);
		category_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		category_validator.validate(operationType, category, "\"category\"");
		
		MPSString entity_validator = new MPSString();
		entity_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 1024);
		entity_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		entity_validator.validate(operationType, entity, "\"entity\"");
		
		MPSString severity_validator = new MPSString();
		severity_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 32);
		severity_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		severity_validator.validate(operationType, severity, "\"severity\"");
		
		MPSString source_validator = new MPSString();
		source_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		source_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		source_validator.validate(operationType, source, "\"source\"");
		
		MPSString failureobj_validator = new MPSString();
		failureobj_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,"[ a-zA-Z0-9_#.:@=-]+");
		failureobj_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		failureobj_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		failureobj_validator.validate(operationType, failureobj, "\"failureobj\"");
		
		MPSInt source_event_id_validator = new MPSInt();
		source_event_id_validator.validate(operationType, source_event_id, "\"source_event_id\"");
		
		MPSInt timestamp_validator = new MPSInt();
		timestamp_validator.validate(operationType, timestamp, "\"timestamp\"");
		
		MPSString message_validator = new MPSString();
		message_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 4096);
		message_validator.validate(operationType, message, "\"message\"");
		
		MPSString operation_type_validator = new MPSString();
		operation_type_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,"[ a-zA-Z0-9_#.:@=-]+");
		operation_type_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 32);
		operation_type_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		operation_type_validator.validate(operationType, operation_type, "\"operation_type\"");
		
		MPSInt trap_id_validator = new MPSInt();
		trap_id_validator.validate(operationType, trap_id, "\"trap_id\"");
		
		MPSString history_validator = new MPSString();
		history_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,"[ a-zA-Z0-9_#.:@=-]+");
		history_validator.validate(operationType, history, "\"history\"");
		
	}
533192
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString id_validator = new MPSString();
		id_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		id_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		id_validator.validate(operationType, id, "\"id\"");
		
		MPSString name_validator = new MPSString();
		name_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		name_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		name_validator.validate(operationType, name, "\"name\"");
		
		MPSString executed_by_validator = new MPSString();
		executed_by_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		executed_by_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		executed_by_validator.validate(operationType, executed_by, "\"executed_by\"");
		
		MPSInt starttime_validator = new MPSInt();
		starttime_validator.validate(operationType, starttime, "\"starttime\"");
		
		MPSInt endtime_validator = new MPSInt();
		endtime_validator.validate(operationType, endtime, "\"endtime\"");
		
		MPSString status_validator = new MPSString();
		status_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		status_validator.validate(operationType, status, "\"status\"");
		
	}
1201482
def _validate_max(self, max_value, field, value):
        
        try:
            if value > max_value:
                self._error(field, errors.MAX_VALUE)
        except TypeError:
            pass