Runs the validations with support for promises. This function will return a promise that is settled when all the validation promises have been completed. It can be called even if no validations returned a promise.
189367
function(attributes, constraints, options) {
      options = v.extend({}, v.async.options, options);

      var WrapErrors = options.wrapErrors || function(errors) {
        return errors;
      };

      // Removes unknown attributes
      if (options.cleanAttributes !== false) {
        attributes = v.cleanAttributes(attributes, constraints);
      }

      var results = v.runValidations(attributes, constraints, options);

      return new v.Promise(function(resolve, reject) {
        v.waitForResults(results).then(function() {
          var errors = v.processValidationResults(results, options);
          if (errors) {
            reject(new WrapErrors(errors, options, attributes, constraints));
          } else {
            resolve(attributes);
          }
        }, function(err) {
          reject(err);
        });
      });
    }
1096560
def ready_validations_pass?
      self.class.ready_validations.all? do |validation|
        passed, message = instance_eval(&validation)
        self.ready_error = message if message && !passed
        passed
      end
    end
1205616
def _begin_validation(
        session: UpdateSession,
        loop: asyncio.AbstractEventLoop,
        downloaded_update_path: str,
        robot_name: str) -> asyncio.futures.Future:
    
    session.set_stage(Stages.VALIDATING)

    validation_future \
        = asyncio.ensure_future(loop.run_in_executor(
            None, validate_update,
            downloaded_update_path, session.set_progress))

    def validation_done(fut):
        exc = fut.exception()
        if exc:
            session.set_error(getattr(exc, 'short', str(type(exc))),
                              str(exc))
        else:
            rootfs_file, bootfs_file = fut.result()
            loop.call_soon_threadsafe(_begin_write,
                                      session,
                                      loop,
                                      rootfs_file,
                                      robot_name)
    validation_future.add_done_callback(validation_done)
    return validation_future
890456
function () {
            this.errors = {};
            return flatten(this._static.validators.map(function runValidator(validator) {
                var col = validator.col, val = this.__values[validator.col], ret = validator.validate(val);
                this.errors[col] = ret;
                return ret;
            }, this));
        }
1370335
protected function runQueuedOn()
    {
        if (!is_null($method = $this->validationScenarios['on'])) {
            call_user_func_array([$this, $method], $this->validationScenarios['parameters']);
        }
    }
1206761
async function validateData (args) {
    debug('validate '+this.name)
    // query all records and iterate over response
    var res = await this.query({
        // skip access control checks
        allow: true,
        // do not cache
        cache: false,
        // make sure session is object
        session: args.session,
    })
    // get response
    debug('checking '+res.length+' records')
    // iterate over records waiting for promise to be resolved
    await res.each(async (rec, num) => {
        // set to true if column needs to be updated
        var needsUpdate = false
        // check if any columns do not match
        _.each(this.extraColumns, (spec, name) => {
            // skip if no data
            if (!rec.data) {
                return
            }
            // if already updating or column value does not match data
            // value then set the update flag to true
            if (needsUpdate || rec.raw[name] !== rec.data[spec.path]) {
                needsUpdate = true
            }
        })
        // go to next record if update not needed
        if (!needsUpdate) {
            return
        }
        // debug
        debug('updating record num '+num)
        // get update sql
        var update = sql.updateExtraColumns(this, rec)
        // do update
        await this.mysql().query(update.sql, update.params, {}, args.session)
        // increment update count
        this.updated++
    })
    // validate complete
    this.validated = true
}
823407
def done_all(self, handlers=None):
        # type: (Promise, Optional[List[Union[Dict[str, Optional[Callable]], Tuple[Callable, Callable], Callable]]]) -> None
        
        if not handlers:
            return

        for handler in handlers:
            if isinstance(handler, tuple):
                s, f = handler
                self.done(s, f)
            elif isinstance(handler, dict):
                s = handler.get("success")  # type: ignore
                f = handler.get("failure")  # type: ignore

                self.done(s, f)
            else:
                self.done(handler)
774135
function (values, model, type) {
        var deferred = Q.defer();
        var modelData = {data: model};

        ModelValidator.validate(values, modelData, function (err, data) {
            deferred.resolve({data: data, err: err, type: type});
        });
        return deferred.promise;
    }
1063653
def _run_validators(self, value):
        
        if value in self.empty_values:
            return

        errors = []
        for validator in self.validators:
            try:
                validator(value)
            except exceptions.ValidationError as err:
                if isinstance(err.messages, dict):
                    errors.append(err.messages)
                else:
                    errors.extend(err.messages)

        if errors:
            raise exceptions.ValidationError(errors)
156213
protected function run()
    {
        futurePromise($this->loop)->then(function (): void {
            $this->check();
        });

        return $this->deferred->promise();
    }
1185849
function() {
          each(this.assertions, function(assertion){
            if (assertion.defer) assertion.run().report(), hook('afterAssertion', assertion)
          })
        }
1177463
function (options, callback) {
            var self = this;

            flow()
                .seq(function (cb) {
                    self.validate(options, cb);
                })
                .seq(function (cb) {
                    if (self.isValid()) {
                        self.save(options, cb);
                    } else {
                        cb(new ValidationError("Model is not valid!", "INVALID_MODEL", "", self));
                    }
                })
                .exec(function (err) {
                    callback && callback(err, self);
                });
        }
1273960
function validationMiddleware (err, req, res, next) {
  if (!err instanceof ValidationError) return next(err);
  return res.status(err.status).send({ errors: err.errors });
}
578866
function Runner(checkit, target, context) {
  this.errors         = {};
  this.checkit        = checkit;
  this.conditional    = checkit.conditional;
  this.target         = _.clone(target || {})
  this.context        = _.clone(context || {})
  this.validator      = new Validator(this.target, checkit.language)
}
1348157
def run_validators(self, value):
        """"""
        errors = []
        for validator in self.validators:
            try:
                validator(value)
            except ValidationError as error:
                errors.extend(error.messages)
        if errors:
            raise ValidationError(errors)
1274048
def validate_callback(callback):
    
    if not(hasattr(callback, '_validated')) or callback._validated == False:
        assert hasattr(callback, 'on_loop_start') \
               or hasattr(callback, 'on_loop_end'), \
               'callback must have `on_loop_start` or `on_loop_end` method'
        if hasattr(callback, 'on_loop_start'):
            setattr(callback, 'on_loop_start',
                    validate_callback_data(callback.on_loop_start))
        if hasattr(callback, 'on_loop_end'):
            setattr(callback, 'on_loop_end',
                    validate_callback_data(callback.on_loop_end))
        setattr(callback, '_validated', True)
    return callback
550656
function doRun() {
    if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening
    Module['calledRun'] = true;

    if (ABORT) return;

    ensureInitRuntime();

    preMain();


    if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();

    if (Module['_main'] && shouldRunNow) Module['callMain'](args);

    postRun();
  }