Verify values after load or may be called individually
with the result of a call to validate() combined with an existing
value.
964068
function verify(key, value) {
  var method = validator[key];
  if(typeof method === 'function') {
    // this will throw the error if verification fails
    // invert argument order as validator methods are more
    // interested in the value than the key
    value = method(value, key);
    if(value !== undefined) {
      this.set(key, value, null, true);
    }
  }

  return value;
}
654834
public function validateValidItem()
    {
        if (!$this->value) {
            return;
        }

        // load allowed values in values_list
        // @todo Imants: Actually we don't need to load all values from Model in
        //       array, just to check couple of posted values.
        //       Probably we should do SELECT * FROM t WHERE id IN ($values) or
        //       something like that to limit array size and time spent on
        //       parsing all DB records in Model.
        $this->getValueList();

        $values = explode($this->separator, $this->value);
        foreach ($values as $v) {
            if (!isset($this->value_list[$v])) {
                $this->displayFieldError("Value $v is not one of the offered values");

                return $this->validate();
            }
        }
    }
354942
def __quick_validate(r, check=('ResultSet', 'Result', 'totalRecords')):
    '''
    
    '''
    if 'ResultSet' in check and 'ResultSet' not in r:
        raise ResultSetError('no ResultSet in server response')
    if 'Result' in check and 'Result' not in r['ResultSet']:
        raise ResultSetError('no Result in server response')
    if 'totalRecords' in check and 'totalRecords' not in r['ResultSet']:
        raise ResultSetError('no totalRecords in server response')
    return True
124231
def _validate(self, value):
        """"""
        if self.values and value not in self.values:
            raise ValueError(
                '{} is not a valid value for {}'.format(value, self.name))
1144370
def validate(self, val):
        """"""
        if self.validation:
            self.type.validate(val)

            if self.custom_validator is not None:
                self.custom_validator(val)

        return True
338371
function validateUniqueness(attr, conf, err, done) {
    var cond = {where: {}};
    cond.where[attr] = this[attr];
    this.constructor.all(cond, function (error, found) {
        if (found.length > 1) {
            err();
        } else if (found.length === 1 && (!this.id || !found[0].id || found[0].id.toString() !== this.id.toString())) {
            err();
        }
        done();
    }.bind(this));
}
338177
function validated(invalid){
            if (invalid) { return callback(invalid) }
            if(options.coerce){crudUtils.coerceData(options,coerced())}
            else{coerced(null,options.data)}
        }
77542
def _validate(self, value):
        
        if value is None:
            raise ValueError('The pk for %s is not "auto-increment", you must fill it' %
                            self._model.__name__)
        value = self.normalize(value)

        # Check that this pk does not already exist
        if self.exists(value):
            raise UniquenessError('PKField %s already exists for model %s)' %
                                  (value, self._instance.__class__))

        return value
622387
def check_error(result):
    
    return (result.value != ReturnCode.SUCCESSFUL) and (result.value < ReturnCode.WARNING)
366285
def validate(self, instance, value):                                       #pylint: disable=inconsistent-return-statements
        """"""
        if not isinstance(value, string_types):
            self.error(instance, value)
        for key, val in self.choices.items():
            test_value = value if self.case_sensitive else value.upper()
            test_key = key if self.case_sensitive else key.upper()
            test_val = val if self.case_sensitive else [_.upper() for _ in val]
            if test_value == test_key or test_value in test_val:
                return key
        self.error(instance, value, extra='Not an available choice.')
846493
def validate(self, instance, value):
        """"""
        value = super(URL, self).validate(instance, value)
        parsed_url = urlparse(value)
        if not parsed_url.scheme or not parsed_url.netloc:
            self.error(instance, value, extra='URL needs scheme and netloc.')
        parse_result = ParseResult(
            scheme=parsed_url.scheme,
            netloc=parsed_url.netloc,
            path=parsed_url.path,
            params='' if self.remove_parameters else parsed_url.params,
            query='' if self.remove_parameters else parsed_url.query,
            fragment='' if self.remove_fragment else parsed_url.fragment,
        )
        parse_result = parse_result.geturl()
        return parse_result
1057456
def validate(self, value):
        
        super(ChoicesField, self).validate(value)
        if value and not self.valid_value(value):
            self._on_invalid_value(value)
192679
def validate(method):
    """"""

    @wraps(method)
    def mod_run(self, rinput):
        self.validate_input(rinput)
        #
        result = method(self, rinput)
        #
        self.validate_result(result)
        return result

    return mod_run
76555
def with_validator(self, validator):
    """"""
    if not callable(validator):
      raise ValueError('Validator must be callable', validator)
    self.validators.append(validator)
    self._cached = None
    return self
53957
def set(self, val, default=False, imported=False):
        
        if hasattr(self.validator, '__call__'):
            try:
                val = self.validator(val)
            except Exception as exc:
                raise type(exc)(
                    'Could not validate value for "%s" setting: %s' %
                    (self.name, exc)
                ) from None
        self.value = val
        self.imported = imported
        if default:
            self.default = val
        self.modified = True
326168
public static void checkLoaded() {
    if (LOAD_ERROR != null) {
      throw LOAD_ERROR;
    }
    // Make a test call, sometimes the error won't occur until you try the native method.
    // 2 ^ 3 = 8, 8 mod 5 = 3
    BigInteger two = BigInteger.valueOf(2);
    BigInteger three = BigInteger.valueOf(3);
    BigInteger four = BigInteger.valueOf(4);
    BigInteger five = BigInteger.valueOf(5);
    BigInteger answer;

    answer = modPowInsecure(two, three, five);
    if (!three.equals(answer)) {
      throw new AssertionError("libgmp is loaded but modPowInsecure returned the wrong answer");
    }

    answer = modPowSecure(two, three, five);
    if (!three.equals(answer)) {
      throw new AssertionError("libgmp is loaded but modPowSecure returned the wrong answer");
    }

    int answr = kronecker(four, five);
    if (answr != 1) {
      throw new AssertionError("libgmp is loaded but kronecker returned the wrong answer");
    }
  }
1331693
public void validate(JavaScriptObject newValues, final I_CmsJavaScriptObjectCallback onSuccess) {

        AsyncCallback<Map<String, String>> rpcCallback = new AsyncCallback<Map<String, String>>() {

            @SuppressWarnings("synthetic-access")
            public void onFailure(Throwable caught) {

                m_apiRoot.handleError(caught, null);
            }

            public void onSuccess(Map<String, String> result) {

                if (result == null) {
                    result = Maps.newHashMap();
                }
                onSuccess.call(CmsJsUtils.convertMapToJsObject(result));
            }
        };
        m_apiRoot.getRpcHelper().executeRpc(
            CmsXmlContentUgcApi.SERVICE.validateContent(
                m_content.getSessionId(),
                CmsJsUtils.convertJsObjectToMap(newValues),
                rpcCallback));

    }