Used for validation during parsing, and additional
		book-keeping.  For internal use only.
497164
def _verifyChildren(self, i):
		
		super(Table, self)._verifyChildren(i)
		child = self.childNodes[i]
		if child.tagName == ligolw.Column.tagName:
			self._update_column_info()
		elif child.tagName == ligolw.Stream.tagName:
			# require agreement of non-stripped strings
			if child.getAttribute("Name") != self.getAttribute("Name"):
				raise ligolw.ElementError("Stream name '%s' does not match Table name '%s'" % (child.getAttribute("Name"), self.getAttribute("Name")))
110864
def validate(self, **kwargs):
        
        self.check_crossrefs()
        for value in self.values():
            value.validate(**kwargs)
1180384
public void validate() {
        check("firstLine", this.firstLine);
        check("beforeEachLine", this.beforeEachLine);
        check("endLine", this.endLine);
        check("firstLineDetectionPattern", this.firstLineDetectionPattern);
        check("lastLineDetectionPattern", this.lastLineDetectionPattern);
        check("isMultiline", this.isMultiline);
        check("allowBlankLines", this.allowBlankLines);
        // skip line can be null
    }
721167
def validate(self, corpus):
        

        passed = True
        results = {}

        for validator in self.validators:
            sub_result = validator.validate(corpus)
            results[validator.name()] = sub_result

            if not sub_result.passed:
                passed = False

        return CombinedValidationResult(passed, results)
975031
def _validate_readonly(self, readonly, field, value):
        
        if readonly:
            if not self._is_normalized:
                self._error(field, errors.READONLY_FIELD)
            # If the document was normalized (and therefore already been
            # checked for readonly fields), we still have to return True
            # if an error was filed.
            has_error = errors.READONLY_FIELD in \
                self.document_error_tree.fetch_errors_from(
                    self.document_path + (field,))
            if self._is_normalized and has_error:
                self._drop_remaining_rules()
185077
def _validate_xtext(xtext):
    """"""

    non_printables = _non_printable_finder(xtext)
    if non_printables:
        xtext.defects.append(errors.NonPrintableDefect(non_printables))
    if utils._has_surrogates(xtext):
        xtext.defects.append(errors.UndecodableBytesDefect(
            "Non-ASCII characters found in header token"))
1339991
private function validateDocument(): void
    {
        if (!$this->is_binary_data) {
            return;
        }

        $res = base64_decode($this->document, true);
        if (false === $res || $this->document !== base64_encode($res)) {
            throw new SyntaxError(sprintf('invalid document, `%s`', $this->document));
        }
    }
98887
def _check_for_legal_children(self, name, elt, mustqualify=1):
        '''
        '''
        inheader = name == "Header"
        for n in _children(elt):
            t = n.nodeType
            if t == _Node.COMMENT_NODE: continue
            if t != _Node.ELEMENT_NODE:
                if t == _Node.TEXT_NODE and n.nodeValue.strip() == "":
                    continue
                raise ParseException("Non-element child in " + name, 
                        inheader, elt, self.dom)
            if mustqualify and not n.namespaceURI:
                raise ParseException('Unqualified element "' + \
                        n.nodeName + '" in ' + name, inheader, elt, self.dom)
1034642
public void validate() {
    Validator validator = this.schema.newValidator();
    InputStream in = null;
    try {
      if(this.xmlFile != null) {
        in = this.xmlFile.openStream();
      } else {
        // TODO: check if we need to specify the encoding
        in = new ByteArrayInputStream(this.serializedRule.getBytes()) ;
      }
      validator.validate(new StreamSource(in));
    } catch (SAXException e) {
      throw new RulesException("Rules file does not conform to the schema", e);
    } catch (IOException e) {
      if(this.xmlFile != null) {
        throw new RulesException("Could not read file " + this.xmlFile, e);
      } else {
        throw new RulesException("Could not read serialized rule " + this.serializedRule, e);
      }
        
    } finally {
      Closeables.closeQuietly(in);
    }
  }
668190
def ISBNValidator(raw_isbn):
    
    isbn_to_check = raw_isbn.replace('-', '').replace(' ', '')

    if not isinstance(isbn_to_check, string_types):
        raise ValidationError(_(u'Invalid ISBN: Not a string'))

    if len(isbn_to_check) != 10 and len(isbn_to_check) != 13:
        raise ValidationError(_(u'Invalid ISBN: Wrong length'))
    
    if not isbn.is_valid(isbn_to_check):
        raise ValidationError(_(u'Invalid ISBN: Failed checksum'))

    if isbn_to_check != isbn_to_check.upper():
        raise ValidationError(_(u'Invalid ISBN: Only upper case allowed'))

    return True
951772
def validateNotationUse(self, ctxt, notationName):
        
        if ctxt is None: ctxt__o = None
        else: ctxt__o = ctxt._o
        ret = libxml2mod.xmlValidateNotationUse(ctxt__o, self._o, notationName)
        return ret
974365
def validate(self):
        ''' 

        '''
        for r in self.roots:
            refs = r.references()
            check_integrity(refs)
15238
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);
    if (StringUtils.isEmpty(valueAsString)) {
      return true;
    }
    if (valueAsString.length() != ISBN10_LENGTH) {
      // ISBN10 size is wrong, but that's handled by size annotation
      return true;
    }
    // calculate and check checksum (ISBN10)
    return CHECK_ISBN.isValidISBN10(valueAsString);
  }
1207908
def validate(role, _environments, cookbooks, roles) # rubocop:disable CyclomaticComplexity
      # validate the role passed in match the name of either the .rb or .json
      file = %W{roles/#{role}.rb roles/#{role}.json}.find { |f| File.exist?(f) }
      role = role.split("/").last if role =~ /\// # pull out directories
      if file
        c_role = evaluate_c_role(file)
        Spiceweasel::Log.debug("role: '#{role}' name: '#{c_role.name}'")
        unless role.eql?(c_role.name)
          STDERR.puts "ERROR: Role '#{role}' listed in the manifest does not match the name '#{c_role.name}' within the #{file} file."
          exit(-1)
        end
        role_run_list(c_role, cookbooks, role, roles)
      else # role is not here
        STDERR.puts "ERROR: Invalid Role '#{role}' listed in the manifest but not found in the roles directory."
        exit(-1)
      end
    end
623742
function validatePluginConfig(book, plugin) {
    var config = book.getConfig();
    var packageInfos = plugin.getPackage();

    var configKey = [
        'pluginsConfig',
        plugin.getName()
    ].join('.');

    var pluginConfig = config.getValue(configKey, {}).toJS();

    var schema = (packageInfos.get('gitbook') || Immutable.Map()).toJS();
    if (!schema) return book;

    // Normalize schema
    schema.id = '/' + configKey;
    schema.type = 'object';

    // Validate and throw if invalid
    var v = new jsonschema.Validator();
    var result = v.validate(pluginConfig, schema, {
        propertyName: configKey
    });

    // Throw error
    if (result.errors.length > 0) {
        throw new error.ConfigurationError(new Error(result.errors[0].stack));
    }

    // Insert default values
    var defaults = jsonSchemaDefaults(schema);
    pluginConfig = mergeDefaults(pluginConfig, defaults);


    // Update configuration
    config = config.setValue(configKey, pluginConfig);

    // Return new book
    return book.set('config', config);
}
983264
def use_isolated_gradebook_view(self):
        """"""
        self._gradebook_view = ISOLATED
        # self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_isolated_gradebook_view()
            except AttributeError:
                pass
552278
function parsePage(book, page) {
    var fs = book.getContentFS();
    var file = page.getFile();

    return fs.readAsString(file.getPath())
    .then(function(content) {
        return parsePageFromString(page, content);
    });
}