def compute_md5s(self, root_path):
    '''Compute MD5s for all files that are missing them.'''
    count = 0
    for (path, fp) in self.fingerprints.iteritems():
      if not fp.md5:
        full_path = join_path(root_path, path)
        log.debug("computing MD5 for file: %s", full_path)
        new_fp = Fingerprint.of_file(full_path, compute_md5=True)
        if new_fp.compare(fp) == Fingerprint.SAME:
          # Add MD5, and also update time, to make it less likely we'll need to recompute
          fp.md5 = new_fp.md5
          fp.mtime = new_fp.mtime
        else:
          raise BadState("fingerprint '%s' does not match old fingerprint '%s' of file (bug or file modified by another process?): '%s'" % (new_fp, fp, full_path))
        count = count + 1
    log.debug("computed MD5s for %s/%s files", count, len(self.fingerprints))
    return count
dataset/ETHPy150Open bloomreach/zinc/zinc.py/FingerprintList.compute_md5s/original