Verifies that the result of the block is the same as the approved
 version.
431976
def verify( options={}, &block )
      approval = Git::Approvals::Approval.new( approval_path, options )
      approval.diff( block.call ) do |err|
        ::RSpec::Expectations.fail_with err
      end
    rescue Errno::ENOENT => e
      ::RSpec::Expectations.fail_with e.message
      EOS
    end
464901
public void verify(@Nullable T value, Path filePath) {
        Pre.notNull(filePath, "filePath");

        File file = mapFilePath(value, filePath);

        File parentPathDirectory = file.getParentFile();
        if (parentPathDirectory != null && !parentPathDirectory.exists()) {
            try {
                fileSystemReadWriter.createDirectories(parentPathDirectory);
            } catch (IOException e) {
                throw new IllegalStateException(e.getMessage(), e);
            }
        }
        Path approvalPath = getApprovalPath(file.toPath());
        byte[] rawValue = converter.getRawForm(value);
        if (!file.exists()) {
            LOG.info(file + " didn't exist. You will be asked for approval");
            handleFirstTimeApproval(file, approvalPath, rawValue);
            return;
        }

        // Change the modification time. This will allow users to delete orphaned files
        // https://github.com/nikolavp/approval/issues/18
        boolean wasAbleSetModified = file.setLastModified(System.currentTimeMillis());
        if (!wasAbleSetModified) {
            LOG.warning("We weren't able to change the modification date for " + file.getAbsolutePath());
        }

        try {
            byte[] fileContent = fileSystemReadWriter.readFully(file.toPath());
            if (!Arrays.equals(fileContent, rawValue)) {
                try {
                    LOG.info("Approval in " + file + " is not the same as the last value. You will be asked for approval of the new value.");
                    fileSystemReadWriter.write(approvalPath, rawValue);
                } catch (IOException e) {
                    throw new AssertionError("Couldn't write the new approval file " + file, e);
                }
                reporter.notTheSame(fileContent, file, rawValue, approvalPath.toFile());
            }
        } catch (IOException e) {
            throw new AssertionError("Couldn't read the previous content in file " + file, e);
        }

        //value approved
    }
1325836
private boolean blockEquals(Block target, Block source)
    {
        boolean found = false;
        if (source instanceof SpecialSymbolBlock && target instanceof SpecialSymbolBlock) {
            if (((SpecialSymbolBlock) target).getSymbol() == ((SpecialSymbolBlock) source).getSymbol()) {
                found = true;
            }
        } else if (source instanceof WordBlock && target instanceof WordBlock) {
            if (((WordBlock) target).getWord().equals(((WordBlock) source).getWord())) {
                found = true;
            }
        } else if (source.equals(target)) {
            found = true;
        }
        return found;
    }
1292877
def verify(self):
        

        if self._is_verified:
            return

        for proxy in self._proxies.values():
            proxy.verify()

        self._is_verified = True
415189
public boolean isMature() {
        if (!isCoinBase())
            return true;

        if (getConfidence().getConfidenceType() != ConfidenceType.BUILDING)
            return false;

        return getConfidence().getDepthInBlocks() >= params.getSpendableCoinbaseDepth();
    }
292605
def verify(otp, counter, retries: 0)
      counters = (counter..counter + retries).to_a
      counters.find do |c|
        super(otp, at(c))
      end
    end
504222
def block_verify( cls, verified_block_header, block_txids ):
        

        block_data = {
            'merkleroot': verified_block_header['merkleroot'],
            'tx': block_txids
        }

        return bits.block_verify( block_data )
484334
private boolean blocksEquals(Block[] a1, Block[] a2, boolean closedFile) {
    if (a1 == a2)
      return true;
    if (a1 == null || a2 == null || a2.length != a1.length)
      return false;

    for (int i = 0; i < a1.length; i++) {
      Block b1 = a1[i];
      Block b2 = a2[i];

      if (b1 == b2)
        continue;
      if (b1 == null || b2 == null)
        return false;

      // compare ids and gen stamps
      if (!(b1.getBlockId() == b2.getBlockId() && b1.getGenerationStamp() == b2
          .getGenerationStamp()))
        return false;

      // for open files check len-2 blocks only
      if (!closedFile && i >= a1.length - 2)
        continue;

      // check block size
      if (b1.getNumBytes() != b2.getNumBytes())
        return false;
    }
    return true;
  }
334242
def in_check_as_result(self, pos, move):
        
        test = cp(pos)
        test.update(move)
        test_king = test.get_king(move.color)

        return self.loc_adjacent_to_opponent_king(test_king.location, test)
71668
def verify(self, checksum=None, token=None, full_response=False):
        """"""
        payload = {"checksum":checksum, "a":"verify"}
        if token:
            payload.update({"token":token})
        return self.get_shards(Shard(**payload), full_response=True)
583758
public static boolean same(Localizable a, Localizable b)
    {
        return Double.compare(a.getX(), b.getX()) == 0 && Double.compare(a.getY(), b.getY()) == 0;
    }
325621
boolean check(IdemixIssuerPublicKey ipk) {

        if (nym == null ||
                issuerNonce == null ||
                proofC == null ||
                proofS == null ||
                ipk == null) {
            return false;
        }

        ECP t = ipk.getHsk().mul(proofS);
        t.sub(nym.mul(proofC));

        byte[] proofData = new byte[0];
        proofData = IdemixUtils.append(proofData, CREDREQUEST_LABEL.getBytes());
        proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(t));
        proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(ipk.getHsk()));
        proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(nym));
        proofData = IdemixUtils.append(proofData, IdemixUtils.bigToBytes(issuerNonce));
        proofData = IdemixUtils.append(proofData, ipk.getHash());


        // Hash proofData to hproofdata
        byte[] hproofdata = IdemixUtils.bigToBytes(IdemixUtils.hashModOrder(proofData));

        return Arrays.equals(IdemixUtils.bigToBytes(proofC), hproofdata);
    }
292146
function satisfies(condition) {
    // Test with real version
    if (semver.satisfies(VERSION, condition)) return true;

    // Test with future stable release
    return semver.satisfies(VERSION_STABLE, condition);
}
1020103
function isVariableModified( $blockName, $varName )
    {
        return ( isset( $this->ModifiedBlockValues[$blockName][$varName] ) and
                 $this->ModifiedBlockValues[$blockName][$varName] );
    }
98297
def verify_header_chain(cls, path, chain=None):
        
        if chain is None:
            chain = SPVClient.load_header_chain( path )

        prev_header = chain[0]
        
        for i in xrange(1, len(chain)):
            header = chain[i]
            height = header.get('block_height')
            prev_hash = prev_header.get('hash')
            if prev_hash != header.get('prev_block_hash'):
                log.error("prev hash mismatch: %s vs %s" % (prev_hash, header.get('prev_block_hash')))
                return False

            bits, target = SPVClient.get_target( path, height/BLOCK_DIFFICULTY_CHUNK_SIZE, chain)
            if bits != header.get('bits'):
                log.error("bits mismatch: %s vs %s" % (bits, header.get('bits')))
                return False

            _hash = header.get('hash')
            if int('0x'+_hash, 16) > target:
                log.error("insufficient proof of work: %s vs target %s" % (int('0x'+_hash, 16), target))
                return False

            prev_header = header

        return True
320709
def verifies( self, hash, signature ):
    

    # From X9.62 J.3.1.

    G = self.generator
    n = G.order()
    r = signature.r
    s = signature.s
    if r < 1 or r > n-1: return False
    if s < 1 or s > n-1: return False
    c = numbertheory.inverse_mod( s, n )
    u1 = ( hash * c ) % n
    u2 = ( r * c ) % n
    xy = u1 * G + u2 * self.point
    v = xy.x() % n
    return v == r
552907
def Verify(self, mempool):
        

        for descriptor in self.Descriptors:
            if not descriptor.Verify():
                return False

        return super(StateTransaction, self).Verify(mempool)