Validate on professional data.
351276
def validate_pro():
    """"""
    cmd = ['python3', 'validate.py', FLAGS.pro_dataset,
           '--use_tpu',
           '--tpu_name={}'.format(TPU_NAME),
           '--work_dir={}'.format(fsdb.working_dir()),
           '--flagfile=rl_loop/distributed_flags',
           '--validate_name=pro']
    mask_flags.run(cmd)
596116
def validate(self):
        """"""
        required_fields = ('slug', 'name', 'process_type', 'version')
        for field in required_fields:
            if getattr(self.metadata, field, None) is None:
                raise ValidationError("process '{}' is missing required meta attribute: {}".format(
                    self.metadata.slug or '<unknown>', field))

        if not PROCESSOR_TYPE_RE.match(self.metadata.process_type):
            raise ValidationError("process '{}' has invalid type: {}".format(
                self.metadata.slug, self.metadata.process_type))
826615
def validate(self, value, model_instance):
        """"""
        if isinstance(value, six.string_types):
            super(JSONField, self).validate(value, model_instance)
            try:
                json.loads(value)
            except Exception as err:
                raise ValidationError(str(err))
472161
def _validate_data(self, data: dict):
        
        log.debug("validating provided data")
        e = best_match(self.validator.iter_errors(data))
        if e:
            custom_error_key = f"error_{e.validator}"
            msg = (
                e.schema[custom_error_key]
                if e.schema.get(custom_error_key)
                else e.message
            )
            raise BadArguments(validation_error=msg, provider=self.name, data=data)
257002
def validate(data):
    
    text = data.get('text')
    if not isinstance(text, _string_types) or len(text) == 0:
        raise ValueError('text field is required and should not be empty')

    if 'markdown' in data and not type(data['markdown']) is bool:
        raise ValueError('markdown field should be bool')

    if 'attachments' in data:
        if not isinstance(data['attachments'], (list, tuple)):
            raise ValueError('attachments field should be list or tuple')

        for attachment in data['attachments']:
            if 'text' not in attachment and 'title' not in attachment:
                raise ValueError('text or title is required in attachment')

    return True
367163
def validate(self, data, schema, **kwargs):
        """"""
        if not isinstance(schema, dict):
            schema = {'$ref': schema}
        return validate(
            data,
            schema,
            resolver=self.ref_resolver_cls.from_schema(schema),
            types=self.app.config.get('RECORDS_VALIDATION_TYPES', {}),
            **kwargs
        )
610161
def _validate_information(self):
        """"""

        needed_variables = ["ModuleName", "ModuleVersion", "APIVersion"]

        for var in needed_variables:
            if var not in self.variables:
                raise DataError("Needed variable was not defined in mib file.", variable=var)

        # Make sure ModuleName is <= 6 characters
        if len(self.variables["ModuleName"]) > 6:
            raise DataError("ModuleName too long, must be 6 or fewer characters.",
                            module_name=self.variables["ModuleName"])

        if not isinstance(self.variables["ModuleVersion"], str):
            raise ValueError("ModuleVersion ('%s') must be a string of the form X.Y.Z" %
                             str(self.variables['ModuleVersion']))

        if not isinstance(self.variables["APIVersion"], str):
            raise ValueError("APIVersion ('%s') must be a string of the form X.Y" % str(self.variables['APIVersion']))

        self.variables['ModuleVersion'] = self._convert_module_version(self.variables["ModuleVersion"])
        self.variables['APIVersion'] = self._convert_api_version(self.variables["APIVersion"])
        self.variables["ModuleName"] = self.variables["ModuleName"].ljust(6)

        self.valid = True
55991
def validate(self, data, all_data=None):
        '''
        
        '''
        if data is None:
            return True, False
        else:
            return super(BooleanField, self).validate(data, all_data)
103276
def validate(ctx, schema, all_schemata):
    """"""

    database = ctx.obj['db']

    if schema is None:
        if all_schemata is False:
            log('No schema given. Read the help', lvl=warn)
            return
        else:
            schemata = database.objectmodels.keys()
    else:
        schemata = [schema]

    for schema in schemata:
        try:
            things = database.objectmodels[schema]
            with click.progressbar(things.find(), length=things.count(),
                                   label='Validating %15s' % schema) as object_bar:
                for obj in object_bar:
                    obj.validate()
        except Exception as e:

            log('Exception while validating:',
                schema, e, type(e),
                '\n\nFix this object and rerun validation!',
                emitter='MANAGE', lvl=error)

    log('Done')
59454
def validate(self):
        """"""
        super().validate()
        nb_entities = len(self.entities)
        if nb_entities != self.rows:
            raise self.error(
                'Number of entities: %s != number of rows: %s' % (
                    nb_entities, self.rows))
378316
def validate(self, model, checks=[]):
        """"""
        custom = [
            check_partial(gene_id_check, frozenset(g.id for g in model.genes))
        ]
        super(EssentialityExperiment, self).validate(
            model=model, checks=checks + custom)
450203
def data_validation(self, in_nc):
        """"""
        data_nc = Dataset(in_nc)
        for dim in self.dims_oi:
            if dim not in data_nc.dimensions.keys():
                data_nc.close()
                raise Exception(self.error_messages[1])

        for var in self.vars_oi:
            if var not in data_nc.variables.keys():
                data_nc.close()
                raise Exception(self.error_messages[2])

        data_nc.close()
        return
39598
def validate():
    """"""

    errors = dict()
    for test in (test_architecture,
                 test_pyqt_availability,
                 test_pyblish_availability,
                 test_qtconf_availability,
                 test_qtconf_correctness,
                 test_qt_availability):
        try:
            test()
        except Exception as e:
            errors[test] = e

    if not errors:
        print("=" * 78)
        print()
        print(""" - Success!

{exe} is well suited to run Pyblish QML""".format(exe=sys.executable))
        print()
        print("=" * 78)

        return True

    print("=" * 78)
    print()
    print(" - Failed")
    print()
    for test, error in errors.iteritems():
        print(test.__name__)
        print("    %s" % error)
    print()
    print("=" * 78)

    return False
355633
def _validate(self, data):
        """"""

        errors = {}

        # if the validator is not enabled, return the empty error dict
        if not self._enabled:
            return errors

        for field in self.validators:

            field_errors = []

            for validator in self.validators[field]:
                try:
                    validator(data.get(field, None))
                except ValidationError as e:
                    field_errors += e.messages

            # if there were errors, cast to ErrorList for output convenience
            if field_errors:
                errors[field] = ErrorList(field_errors)

        return errors
650390
def Validate(self,
               problems=None,
               validate_children=True,
               today=None,
               service_gap_interval=None):
    """"""

    if not problems:
      problems = self.problem_reporter

    self.ValidateAgenciesHaveSameAgencyTimezone(problems)
    self.ValidateFeedInfoLangMatchesAgencyLang(problems)
    self.ValidateServiceRangeAndExceptions(problems, today,
                                           service_gap_interval)
    # TODO: Check Trip fields against valid values
    self.ValidateStops(problems, validate_children)
    #TODO: check that every station is used.
    # Then uncomment testStationWithoutReference.
    self.ValidateNearbyStops(problems)
    self.ValidateRouteNames(problems, validate_children)
    self.ValidateTrips(problems)
    self.ValidateRouteAgencyId(problems)
    self.ValidateTripStopTimes(problems)
    self.ValidateUnusedShapes(problems)
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)
236934
def _make_validations(self, table: pd.DataFrame) -> Box:
        """"""
        results = []

        for column in self.columns:
            results.append(column.validate(table))

        return results