Validate the table option "aging-field".
171924
private void validateTableOptionAgingField(TableDefinition tableDef, String optValue) {
        FieldDefinition agingFieldDef = tableDef.getFieldDef(optValue);
        Utils.require(agingFieldDef != null,
                      "Aging field has not been defined: " + optValue);
        assert agingFieldDef != null;   // Make FindBugs happy
        Utils.require(agingFieldDef.getType() == FieldType.TIMESTAMP,
                      "Aging field must be a timestamp field: " + optValue);
        Utils.require(tableDef.getOption(CommonDefs.OPT_RETENTION_AGE) != null,
                      "Option 'aging-field' requires option 'retention-age'");
    }
266962
def validate(self, value):
        """"""
        if value is not None:
            if not isinstance(value, list):
                raise ValidationError("field must be a list")

            for index, element in enumerate(value):
                try:
                    self.inner.validate(element)
                except ValidationError as error:
                    raise ValidationError("invalid element {}: {}".format(
                        index,
                        error.args[0],
                    ))

        super().validate(value)
989594
def validate(self):
        """"""
        # check if required_fields aren't present
        for field in set(self.required_fields) - set(self.request_data):
            if not isinstance(field, string_types):
                # field was a collection, iterate over it and check by OR
                return bool(set(field) & set(self.request_data))
            return False
        return True
373811
function validateOptions(options) {
  const {
    lifecycleExperimental,
    disableLifecycleMethods,
    enableComponentDidUpdateOnSetState,
    supportPrevContextArgumentOfComponentDidUpdate,
    lifecycles,
  } = options;
  if (typeof lifecycleExperimental !== 'undefined' && typeof lifecycleExperimental !== 'boolean') {
    throw new Error('lifecycleExperimental must be either true or false if provided');
  }

  if (typeof disableLifecycleMethods !== 'undefined' && typeof disableLifecycleMethods !== 'boolean') {
    throw new Error('disableLifecycleMethods must be either true or false if provided');
  }

  if (
    lifecycleExperimental != null
    && disableLifecycleMethods != null
    && lifecycleExperimental === disableLifecycleMethods
  ) {
    throw new Error('lifecycleExperimental and disableLifecycleMethods cannot be set to the same value');
  }

  if (
    typeof enableComponentDidUpdateOnSetState !== 'undefined'
    && lifecycles.componentDidUpdate
    && lifecycles.componentDidUpdate.onSetState !== enableComponentDidUpdateOnSetState
  ) {
    throw new TypeError('the legacy enableComponentDidUpdateOnSetState option should be matched by `lifecycles: { componentDidUpdate: { onSetState: true } }`, for compatibility');
  }

  if (
    typeof supportPrevContextArgumentOfComponentDidUpdate !== 'undefined'
    && lifecycles.componentDidUpdate
    && lifecycles.componentDidUpdate.prevContext !== supportPrevContextArgumentOfComponentDidUpdate
  ) {
    throw new TypeError('the legacy supportPrevContextArgumentOfComponentDidUpdate option should be matched by `lifecycles: { componentDidUpdate: { prevContext: true } }`, for compatibility');
  }
}
272000
def _validate_x(self, x, z):
        """"""

        if (x < 0) or (x > ((2**z) - 1)):
            raise InvalidColumnError(
                "{} is not a valid value for x (column)".format(x)
            )

        return x
1225967
def validate(self):
        
        try:
            Configuration(**self.serialize())
        except ValidationException as e:
            raise DbtProjectError(str(e))

        if getattr(self.args, 'version_check', False):
            self.validate_version()
376418
def validate(self):
        """"""
        validate_rows_length(self.data, self.columns, exception=self.error)
        validate_categories_equal_entities(self.categories, self.entities,
                                           exception=self.error)
        if self.square:
            validate_square(self.data, exception=self.error)
929395
def validate(self, value, model_instance):
        """"""
        # raise validation error if the use of this field says it can't be blank but it is
        if not self.blank and value is self.Empty:
            raise ValidationError(self.error_messages['blank'])
        else:
            return super(OpaqueKeyField, self).validate(value, model_instance)
1048066
function validateNode(opts: Options) {
    const isRow = node => node.type === opts.typeRow;
    const isCell = node => node.type === opts.typeCell;
    const countCells = row => row.nodes.count(isCell);

    return node => {
        if (node.type !== opts.typeTable) {
            return undefined;
        }

        const rows = node.nodes.filter(isRow);
        const maxColumns = Math.max(
            // Minimum 1 column
            1,
            rows.map(countCells).max()
        );
        const rowsMissingColumns = rows.filter(
            row => countCells(row) < maxColumns
        );

        if (rowsMissingColumns.isEmpty()) {
            return undefined;
        }

        return change => {
            rowsMissingColumns.forEach(row => {
                const numberOfCellsToAdd = maxColumns - row.nodes.size;
                const cells = Array.from({ length: numberOfCellsToAdd }).map(
                    () => createCell(opts)
                );
                cells.forEach(cell =>
                    change.insertNodeByKey(row.key, row.nodes.size, cell, {
                        normalize: false
                    })
                );
            });
        };
    };
}
1307028
protected function validateOptionsFields()
    {
        if ($this->submittedValues['optionsAllOn1Line'] == PHP_INT_MAX && $this->submittedValues['optionsAllOnOwnLine'] == 1) {
            $this->errorMessages['optionsAllOnOwnLine'] = $this->t('message_validate_options_0');
        }
        if ($this->submittedValues['optionsAllOn1Line'] > $this->submittedValues['optionsAllOnOwnLine'] && $this->submittedValues['optionsAllOnOwnLine'] > 1) {
            $this->errorMessages['optionsAllOnOwnLine'] = $this->t('message_validate_options_1');
        }

        if (isset($this->submittedValues['optionsMaxLength']) && !ctype_digit($this->submittedValues['optionsMaxLength'])) {
            $this->errorMessages['optionsMaxLength'] = $this->t('message_validate_options_2');
        }
    }
611294
protected void validate(List<TableInfo> tableInfos)
    {
        try
        {
            KsDef ksDef = cassandra_client.describe_keyspace(databaseName);
            onValidateTables(tableInfos, ksDef);
        }
        catch (Exception ex)
        {
            log.error("Error occurred while validating {}, Caused by: .", databaseName, ex);
            throw new SchemaGenerationException(ex);
        }
    }
1076801
@Override
    protected void validate(List<TableInfo> tableInfos)
    {
        for (TableInfo tableInfo : tableInfos)
        {
            try
            {
                if (tableAPI.getTable(tableInfo.getTableName()) == null)
                {
                    logger.error("No table found for " + tableInfo.getTableName());
                    throw new SchemaGenerationException("No table found for " + tableInfo.getTableName());
                }
            }
            catch (FaultException e)
            {
                logger.error("Error while getting table " + tableInfo.getTableName() + ". Caused By: ", e);
                throw new SchemaGenerationException(e, "Error while getting table " + tableInfo.getTableName()
                        + ". Caused By: ");
            }
        }
    }
1309397
def validate_value(self, value):
        """"""
        super(ValuesListField, self).validate_value(value)

        if value is not None:
            if value not in self.selection_to_id_map:
                raise ValidationError(
                    self.record,
                    'Field "{}" invalid value "{}". Valid options: {}'.format(
                        self.name,
                        value,
                        ', '.join(self.selection_to_id_map.keys())
                    )
                )
1334254
function validateField(field, cb) {
        if (_.isArray(field.validation)) {
            async.each(field.validation, performValidation(field), function(err) {
                cb(err);
            });
        } else {
            cb();
        }
    }
303731
def ValidateYesNoUnknown(value, column_name=None, problems=None):
  """"""
  if IsEmpty(value) or IsValidYesNoUnknown(value):
    return True
  else:
    if problems:
      problems.InvalidValue(column_name, value)
    return False
770352
def validateField(self, field) :
        """"""
        if field not in self.validators and not self.collection._validation['allow_foreign_fields'] :
            raise SchemaViolation(self.collection.__class__, field)

        if field in self.store:
            if isinstance(self.store[field], DocumentStore) :
                return self[field].validate()
            
            if field in self.patchStore :
                return self.validators[field].validate(self.patchStore[field])
            else :
                try :
                    return self.validators[field].validate(self.store[field])
                except ValidationError as e:
                    raise ValidationError( "'%s' -> %s" % ( field, str(e)) )
                except AttributeError:
                    if isinstance(self.validators[field], dict) and not isinstance(self.store[field], dict) :
                        raise ValueError("Validator expected a sub document for field '%s', got '%s' instead" % (field, self.store[field]) )
                    else :
                        raise
        return True
734938
def _ValidateClosedTimeRange(time_range):
  """"""
  time_range_start, time_range_end = time_range
  _ValidateTimestamp(time_range_start)
  _ValidateTimestamp(time_range_end)
  if time_range_start > time_range_end:
    raise ValueError("Invalid time-range: %d > %d." %
                     (time_range_start.AsMicrosecondsSinceEpoch(),
                      time_range_end.AsMicrosecondsSinceEpoch()))