Fetches the validation set of the corpus.
434585
def get_valid_fns(self) -> Tuple[List[str], List[str]]:
        
        return self.prefixes_to_fns(self.valid_prefixes)
321189
function(set) {
        var dtype, valids, typeClass, self = this;
        //
        if (utils.isString(set)) {
            // resolve data type
            typeClass = this.dataTypes.get(set);
            if (typeClass) { dtype = new typeClass(); }
        }
        else if (set) {
            utils.each(set, function(key, val) {
                if (!utils.hasOwn(set, key)) {
                    return;
                }
                if (key.toLowerCase() === 'type') {
                    // resolve data type
                    typeClass = self.dataTypes.get(val);
                    if (typeClass) { dtype = new typeClass(); }
                } else {
                    // resolve validators
                    typeClass = self.validators.get(key);
                    if (typeClass) {
                        if (!valids) { valids = []; }
                        valids.push(new typeClass(set[key]));
                    }
                }
            });
        }
        return new modellingMetas(dtype, valids);
    }
1251273
def validate(self):
        """"""
        for context_name in self.context_names:
            context = self.context(context_name)
            try:
                context.validate()
            except ResolvedContextError as e:
                raise SuiteError("Error in context %r: %s"
                                 % (context_name, str(e)))
1082995
public function getValidators()
    {
        $this->validators = $this->generateInputs();

        $translatedInputs = [];

        foreach ($this->validators as $key => $validator) {
            $translatedOperators = [];

            foreach ($validator['availableOperators'] as $availableOperators) {
                $translatedOperators[$availableOperators] = Operators::getI18n(
                    $this->translator,
                    $availableOperators
                );
            }

            $validator['availableOperators'] = $translatedOperators;

            $translatedInputs[$key] = $validator;
        }

        $validators = [
            'inputs'       => $translatedInputs,
            'setOperators' => $this->operators,
            'setValues'    => $this->values
        ];

        return $validators;
    }
311567
def validate(self):
        
        log.info("{}\nValidating against {}"
                 .format("-" * 100, self.schema_def.__class__.__name__))

        if not self.schema_def:
            raise ValueError("No schema definition supplied.")

        self.checked_attributes = []

        # TODO - this should maybe choose the actually used namespace, not just
        # the first one in the list
        result = ValidationResult(self.allowed_namespaces[0],
                                  self.schema_def.__class__.__name__)
        for subject, predicate, object_ in self.graph:
            log.info("\nsubj: {subj}\npred: {pred}\n obj: {obj}"
                     .format(subj=subject, pred=predicate,
                             obj=object_.encode('utf-8')))
            result.add_error(self._check_triple((subject, predicate, object_)))
        return result
283488
@SuppressWarnings({"unchecked"})
  public final ArrayList<ConstraintViolation<?>> getValidationErrorSet(final Object pclass) {
    return new ArrayList<>(validationErrorSet.stream()
        .map(violation -> ConstraintViolationImpl.forBeanValidation( //
            violation.getMessageTemplate(), //
            Collections.emptyMap(), //
            Collections.emptyMap(), //
            violation.getMessage(), //
            ((SerializeableConstraintValidationImpl<Object>) violation).getRootBeanClass(), //
            pclass, //
            violation.getLeafBean(), //
            null, //
            violation.getPropertyPath(), //
            violation.getConstraintDescriptor(), //
            null, //
            null))
        .collect(Collectors.toList()));
  }
164703
public function validate(): array
	{
		if($this->isInvalid())
		{
			throw new ValidationException($this->errors, 'Invalid input.');
		}

		$validated = [];

		foreach(array_keys($this->ruleSets) as $validatedKey)
		{
			if(Arr::has($this->input, $validatedKey))
			{
				Arr::set($validated, $validatedKey, Arr::get($this->input, $validatedKey));
			}
		}

		return $validated;
	}
800498
public List<ValidatorElement> getAllValidatorElements() {
        List<ValidatorElement> ret = CollectionUtil.createArrayList();
        for (ListAble<ValidatorElement> e : validatorElementLinkedList) {
            ret.addAll(e.getAsList());
        }
        return ret;
    }
500470
public Set<ConstraintViolation> validate() {
		Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
		for (int record = 1; record <= 3; ++record) {
			errors.addAll(validate(record));
		}
		return errors;
	}
291529
protected function getValidationRules(): array
    {
        $validationRulesFromRepository = $this->repository->getModelValidationRules();

        return !empty($validationRulesFromRepository) ? $validationRulesFromRepository : $this->validationRules;
    }
581500
def _validate_output_data(
        self, original_res, serialized_res, formatted_res, request):
        

        validator = self.representation

        # when not to validate...
        if not validator:
            return

        try:
            if isinstance(serialized_res, (list, tuple)):
                map(validator.validate, serialized_res)
            else:
                validator.validate(serialized_res)
        except ValidationError, exc:
            self._output_validation_failed(exc, serialized_res, request)
1064911
public function read()
    {
        if ($this->isComplete) {
            throw new ValidationException("Cannot call read() after streaming call is complete.");
        }
        $resourcesGetMethod = $this->resourcesGetMethod;
        if (!is_null($resourcesGetMethod)) {
            if (count($this->pendingResources) === 0) {
                $response = $this->call->read();
                if (!is_null($response)) {
                    $pendingResources = [];
                    foreach ($response->$resourcesGetMethod() as $resource) {
                        $pendingResources[] = $resource;
                    }
                    $this->pendingResources = array_reverse($pendingResources);
                }
            }
            $result = array_pop($this->pendingResources);
        } else {
            $result = $this->call->read();
        }
        if (is_null($result)) {
            $status = $this->call->getStatus();
            $this->isComplete = true;
            if (!($status->code == Code::OK)) {
                throw ApiException::createFromStdClass($status);
            }
        }
        return $result;
    }
1311361
def _validate_tag_sets(tag_sets):
    
    if tag_sets is None:
        return tag_sets

    if not isinstance(tag_sets, list):
        raise TypeError((
            "Tag sets %r invalid, must be a list") % (tag_sets,))
    if len(tag_sets) == 0:
        raise ValueError((
            "Tag sets %r invalid, must be None or contain at least one set of"
            " tags") % (tag_sets,))

    for tags in tag_sets:
        if not isinstance(tags, Mapping):
            raise TypeError(
                "Tag set %r invalid, must be an instance of dict, "
                "bson.son.SON or other type that inherits from "
                "collection.Mapping" % (tags,))

    return tag_sets
705723
def validate(self):
        
        validation_result = []
        for attr_name, value in [(attr, getattr(self, attr)) for attr in self._attribute_map]:
            attr_desc = self._attribute_map[attr_name]
            if attr_name == "additional_properties" and attr_desc["key"] == '':
                # Do NOT validate additional_properties
                continue
            attr_type = attr_desc['type']

            try:
                debug_name = "{}.{}".format(self.__class__.__name__, attr_name)
                Serializer.validate(value, debug_name, **self._validation.get(attr_name, {}))
            except ValidationError as validation_error:
                validation_result.append(validation_error)

            validation_result += _recursive_validate(attr_name, attr_type, value)
        return validation_result
260934
def get_corpus(args):
    """"""
    tokenizer = get_tokenizer(args)
    return tacl.Corpus(args.corpus, tokenizer)
1222417
def validate(self) -> ValidationResult:
        
        result = ValidationResult()
        try:
            for rule in self.get_rules():
                try:
                    if not rule.apply():
                        result.annotate_rule_violation(rule)
                        if rule.stop_if_invalid:
                            break
                except Exception as e:
                    result.annotate_exception(e, rule)
        except Exception as e:
            result.annotate_exception(e, None)
        return result
189181
def _get_corpus_properties(self, corpus_name):
        
        try:
            # corpora = LANGUAGE_CORPORA[self.language]
            corpora = self.all_corpora
        except NameError as name_error:
            msg = 'Corpus not available for language ' \
                  '"%s": %s' % (self.language, name_error)
            logger.error(msg)
            raise CorpusImportError(msg)
        for corpus_properties in corpora:
            if corpus_properties['name'] == corpus_name:
                return corpus_properties
        msg = 'Corpus "%s" not available for the ' \
              '"%s" language.' % (corpus_name, self.language)
        logger.error(msg)
        raise CorpusImportError(msg)