Validates each record and returns error count if record is invalid
966726
def validate_record(errors_count, row_hash, index)
      record = new(row_hash)
      unless record.valid?
        errors_count += 1
        [nil, errors_count, log_and_return_validation_error(record, row_hash, index)]
      else
        [record, errors_count, nil]
      end
    end
742773
function validation($data, $files) {
        global $COURSE, $DB;

        $errors = parent::validation($data, $files);

        $name = trim($data['name']);
        if (isset($data['idnumber'])) {
            $idnumber = trim($data['idnumber']);
        } else {
            $idnumber = '';
        }
        if ($data['id'] and $grouping = $DB->get_record('groupings', array('id'=>$data['id']))) {
            if (core_text::strtolower($grouping->name) != core_text::strtolower($name)) {
                if (groups_get_grouping_by_name($COURSE->id,  $name)) {
                    $errors['name'] = get_string('groupingnameexists', 'group', $name);
                }
            }
            if (!empty($idnumber) && $grouping->idnumber != $idnumber) {
                if (groups_get_grouping_by_idnumber($COURSE->id, $idnumber)) {
                    $errors['idnumber']= get_string('idnumbertaken');
                }
            }

        } else if (groups_get_grouping_by_name($COURSE->id, $name)) {
            $errors['name'] = get_string('groupingnameexists', 'group', $name);
        } else if (!empty($idnumber) && groups_get_grouping_by_idnumber($COURSE->id, $idnumber)) {
            $errors['idnumber']= get_string('idnumbertaken');
        }

        return $errors;
    }
767820
private function _readDataValidations()
	{
		$length = self::_GetInt2d($this->_data, $this->_pos + 2);
		$recordData = $this->_readRecordData($this->_data, $this->_pos + 4, $length);

		// move stream pointer forward to next record
		$this->_pos += 4 + $length;
	}
920520
def validate_collection_association(reflection)
        if association = association_instance_get(reflection.name)
          if records = associated_records_to_validate_or_save(association, new_record?, reflection.options[:autosave])
            records.each_with_index { |record, index| association_valid?(reflection, record, index) }
          end
        end
      end
1354873
function _each (result, callback, context, recordNum, resolve, reject) {
    // fetch more records
    result.fetch()
    // iterate over fetched records
    .then(records => {
        if (!records || !records.length) {
            return
        }
        // iterate over records
        return Promise.each(records, record => {
            // wait for callback to complete if it returns promise
            return callback(record, recordNum++, context)
        })
    })
    .then(() => {
        // resolve parent promise if done
        if (result.done) {
            resolve(context)
        }
        // iterate over more records if not all fetched
        else {
            _each(result, callback, context, recordNum, resolve, reject)
        }
    })
    // pass errors to parent promise
    .catch(reject)
}
1013633
def validate(record)
      if record.password_provider? or options[:force]
        if record.new_record? and record.password.to_s.blank? and !record.password_changed?
          record.errors.add :password, :blank
        elsif record.password_changed?
          if record.password.to_s.size < 4
            record.errors.add :password, :invalid_password
          elsif record.password.to_s != record.password_confirmation.to_s
            record.errors.add :password, :no_match_password
          end
        end
      end
    end
1205904
def validate(self, value, add_comments=False, schema_name="map"):
        
        validator = self.get_schema_validator(schema_name)

        error_messages = []

        if isinstance(value, list):
            for d in value:
                error_messages += self._validate(d, validator, add_comments, schema_name)
        else:
            error_messages = self._validate(value, validator, add_comments, schema_name)

        return error_messages
1251845
public Set<ConstraintViolation> validate(int record) {
		Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
		for (int ds = 0; ds < 250; ++ds) {
			try {
				DataSetInfo dataSetInfo = dsiFactory.create(IIM.DS(record, ds));
				errors.addAll(validate(dataSetInfo));
			} catch (InvalidDataSetException ignored) {
				// DataSetFactory doesn't know about this ds, so will skip it
			}
		}
		return errors;
	}
1356463
def validate
      errors = {}

      call_validators do |name, message|
        errors[name] ||= []
        errors[name] << to_error(message)
      end

      errors
    end
1033263
def validations
      name = @name
      @klass.send(:validates_each, name) do |record, attr, value|
        record.send(name).errors.each do |error|
          record.errors.add(name, error)
        end
      end
    end
13744
def check(self, records):
        """"""
        for value, target in records:
            LOGGER.info("%s [%s]: %s", self.name, target, value)
            if value is None:
                self.notify(self.no_data, value, target)
                continue
            for rule in self.rules:
                if self.evaluate_rule(rule, value, target):
                    self.notify(rule['level'], value, target, rule=rule)
                    break
            else:
                self.notify('normal', value, target, rule=rule)

            self.history[target].append(value)
356300
def validate_each(record, attribute, value)
      begin
        unless value.blank?
          IPAddr.new(value)
          if options[:no_mask]
            if value =~ /\//
              record.errors[attribute] << (options[:message] || 'must not contain a mask')
            end
          elsif options[:require_mask]
            unless value =~ /\//
              record.errors[attribute] << (options[:message] || 'must contain a mask')
            end
          end
        end
      rescue IPAddr::InvalidAddressError
        record.errors[attribute] << (options[:message] || 'is not a valid IP address')
      end
    end
617452
def validate(self):
        """"""
        if self.error:
            return False

        for v in self.validators:
            self.error = v(self.value)
            if self.error:
                return False

        return True
332827
def error_count(self):
        """"""
        count = 0
        for error_list in self.error_dict.values():
            count += len(error_list)
        return count
1172975
def validate(record)
      if record._database_validations_fallback
        super
      else
        return unless record.public_send(foreign_key).blank? && record.public_send(association).blank?

        record.errors.add(association, :blank, message: BelongsToOptions::VALIDATOR_MESSAGE)
      end
    end
306587
private function validate()
    {
        if (!$this->table) {
            throw new BatchInsertException('Batch Table must be defined');
        }

        $requiredCount = count($this->rows);

        if ($requiredCount == 0) {
            throw new BatchInsertException('Batch Rows cannot be empty');
        }

        foreach ($this->values as $value) {
            if (count($value) !== $requiredCount) {
                throw new BatchInsertException('Batch Values must match the same column count of ' . $requiredCount);
            }
        }
    }
1085769
def valid?
      errors.clear

      validators.each do |validator|
        validator.validate(self)
      end

      errors.empty?
    end