Verify that self is a valid CArchive.

            Magic signature is at end of the archive.
174045
def checkmagic(self):
        """"""
        #magic is at EOF; if we're embedded, we need to figure where that is
        if self.len:
            self.lib.seek(self.start+self.len, 0)
        else:
            self.lib.seek(0, 2)
        filelen = self.lib.tell()
        if self.len:
            self.lib.seek(self.start+self.len-self.TRLLEN, 0)
        else:
            self.lib.seek(-self.TRLLEN, 2)
        (magic, totallen, tocpos, toclen, pyvers) = struct.unpack(self.TRLSTRUCT,
                            self.lib.read(self.TRLLEN))
        if magic != self.MAGIC:
            raise RuntimeError("%s is not a valid %s archive file"
                               % (self.path, self.__class__.__name__))
        self.pkgstart = filelen - totallen
        if self.len:
            if totallen != self.len or self.pkgstart != self.start:
                raise RuntimeError, "Problem with embedded archive in %s" % self.path
        self.tocpos, self.toclen = tocpos, toclen
1170306
def verify(wheelfile):
    
    warn_signatures()
    wf = WheelFile(wheelfile)
    sig_name = wf.distinfo_name + '/RECORD.jws'
    try:
        sig = json.loads(native(wf.zipfile.open(sig_name).read()))
    except KeyError:
        raise WheelError('The wheel is not signed (RECORD.jws not found at end of the archive).')

    verified = signatures.verify(sig)
    print("Signatures are internally consistent.", file=sys.stderr)
    print(json.dumps(verified, indent=2))
823094
def verify(data, sig)
      regenerate_pubkey unless @key.public_key
      sig = Bitcoin::OpenSSL_EC.repack_der_signature(sig)
      if sig
        @key.dsa_verify_asn1(data, sig)
      else
        false
      end
    end
1074631
def verify(self, chksum):
        
        total = 0

        # Add together all bytes
        for byte in self.data:
            total += byteToInt(byte)

        # Add checksum too
        total += byteToInt(chksum)

        # Only keep low bits
        total &= 0xFF

        # Check result
        return total == 0xFF
1090866
def verify(
    signature: Ed25519Signature, digest: bytes, pub_key: Ed25519PublicPoint
) -> None:
    """"""
    # XXX this *might* change to bool function
    _ed25519.checkvalid(signature, digest, pub_key)
1181405
def verify(self):
        

        # remember file pointer
        pos = self.tell()
        self.seek(0)

        checksum = 0
        for chunk in iter(lambda: self.read(1024), b''):
            checksum = crc32(chunk, checksum)

        # restore file pointer
        self.seek(pos)

        return self.crc32 == checksum & 0xffffffff
817884
def verify(self):
        ''''''

        c = self.database.cursor()
        non_exist = set()

        no_db_entry = set(os.listdir(self.cache_dir))
        try:
            no_db_entry.remove('file_database.db')
            no_db_entry.remove('file_database.db-journal')
        except:
            pass

        for row in c.execute("SELECT path FROM files"):
            path = row[0]

            repo_path = os.path.join(self.cache_dir, path)

            if os.path.exists(repo_path):
                no_db_entry.remove(path)
            else:
                non_exist.add(path)

        if len(non_exist) > 0:
            raise Exception(
                "Found {} records in db for files that don't exist: {}" .format(
                    len(non_exist),
                    ','.join(non_exist)))

        if len(no_db_entry) > 0:
            raise Exception("Found {} files that don't have db entries: {}"
                            .format(len(no_db_entry), ','.join(no_db_entry)))
357654
def check(self, request, consumer, token, signature):
        """"""
        built = self.sign(request, consumer, token)
        return built == signature
668428
def valid(*things):
	''''''
	for thing in things:
		if type(thing) is str and not os.path.exists(thing):
			return False
		if thing.valid is None:
			return False
	return True
841635
def signed?
            begin
                self.Catalog.AcroForm.is_a?(Dictionary) and
                self.Catalog.AcroForm.SigFlags.is_a?(Integer) and
                (self.Catalog.AcroForm.SigFlags & InteractiveForm::SigFlags::SIGNATURES_EXIST != 0)
            rescue InvalidReferenceError
                false
            end
        end
375478
def validate(self):
        
        if self._schema is not None:
            with MemoryFile() as memfile:
                with memfile.open(driver="ESRI Shapefile", schema=self.schema) as target:
                    for _item in self._results:
                        # getting rid of the assets that don't behave well becasue of in memroy rasters
                        item = GeoFeature(_item.geometry, _item.properties)
                        target.write(item.to_record(item.crs))
871832
def verify(self, sign, *args, **kwargs):
        '''
        
        '''
        return self.verify_file(self.create_stream(sign), *args, **kwargs)
519114
private boolean verify(String version, Long time) {
    if (versionToItem.containsKey(version)) {
      Path path = collectionCachePath.resolve(version);
      File file = path.toFile();
      if (file.exists() && file.canRead() && file.canWrite()) {
        if (time != null) {
          if (!file.setLastModified(time)) {
            log.debug("couldn't change filetime " + file.getAbsolutePath());
          } else {
            expirationVersion.put(version, time + (1000 * lifeTime));
          }
        }
        return true;
      } else {
        return false;
      }
    } else {
      return false;
    }
  }
339261
def is_archive(filename):
    ''''''
    for archive in archive_formats:
        if filename.endswith(archive_formats[archive]['suffix']):
            return True
    return False
1161195
def verify(self):
        
        collections = self.get_data_collections()

        allIDs = []
        for coll in collections:
            IDs = self.noteDB[coll].find({"ID": {"$exists": True}},
                                         {"ID": 1, "_id": 0})
            for ID in IDs:
                allIDs.append(int(ID["ID"]))

        query = {"currentMax": {"$exists": True}}
        maxID = int(self.noteDB['IDs'].find_one(query)["currentMax"])
        query = {"unusedIDs": {"$exists": True}}
        unusedIDs = self.noteDB['IDs'].find_one(query)["unusedIDs"]
        unusedIDs = [int(ii) for ii in unusedIDs]

        unusedIDsMatch = True
        for ID in allIDs:
            if ID in unusedIDs:
                unusedIDsMatch = False

        maxIDMatch = True
        if maxID is not max(allIDs):
            maxIDMatch = False

        if maxIDMatch and unusedIDsMatch:
            print "Database is valid"
        elif not maxIDMatch and not unusedIDsMatch:
            print "Database not valid, max ID and unused IDs are incorrent"
        elif not maxIDMatch:
            print "Database not valid, max ID is incorrent"
        elif not unusedIDsMatch:
            print "Database not valid, unusedIDs is incorrent"
192764
async def serialize_archive(self, ar, version=None):
        
        # Transaction prefix serialization first.
        await ar.message(self, TransactionPrefix)

        if self.version == 1:
            await ar.tag('signatures')
            await ar.begin_array()
            await ar.prepare_container(len(self.vin), eref(self, 'signatures'), elem_type=SignatureArray)
            signatures_not_expected = len(self.signatures) == 0
            if not signatures_not_expected and len(self.vin) != len(self.signatures):
                raise ValueError('Signature size mismatch')

            for i in range(len(self.vin)):
                sig_size = get_signature_size(self.vin[i])
                if signatures_not_expected:
                    if 0 == sig_size:
                        continue
                    else:
                        raise ValueError('Unexpected sig')

                await ar.prepare_container(sig_size, eref(self.signatures, i), elem_type=SignatureArray)
                if sig_size != len(self.signatures[i]):
                    raise ValueError('Unexpected sig size')

                for j in range(sig_size):
                    await ar.field(eref(self.signatures[i], j), Signature)

        else:
            await ar.tag('rct_signatures')
            if len(self.vin) == 0:
                return

            await ar.begin_object()
            await ar.prepare_message(eref(self, 'rct_signatures'), RctSig)
            await self.rct_signatures.serialize_rctsig_base(ar, len(self.vin), len(self.vout))
            await ar.end_object()

            if self.rct_signatures.type != RctType.Null:
                mixin_size = len(self.vin[0].key_offsets) - 1 if len(self.vin) > 0 and isinstance(self.vin[0], TxinToKey) else 0
                await ar.tag('rctsig_prunable')
                await ar.begin_object()
                await ar.prepare_message(eref(self.rct_signatures, 'p'), RctSigPrunable)
                await self.rct_signatures.p.serialize_rctsig_prunable(ar, self.rct_signatures.type,
                                                                      len(self.vin), len(self.vout),
                                                                      mixin_size)
                await ar.end_object()
        return self
1089682
def Verify(self, mempool):
        
        logger.info("Verifying transaction: %s " % self.Hash.ToBytes())

        return Helper.VerifyScripts(self)