original_docstring: A helper function to calculate MD5 sums to make sure we grab files
      without corruption.
docstring: A helper function to calculate MD5 sums to make sure we grab files
  without corruption.
docstring_tokens: A helper function to calculate MD5 sums to make sure we grab files without corruption .
code: def calculate_md5(fname, blocksize=8192):
      """A helper function to calculate MD5 sums to make sure we grab files
      without corruption."""
      #   If the supplied block size isn't a multiple of 128, then we will exit
      #   with an error, since md5 has a digest block size of 128 bytes
      #   Start the md5 digest object
      md5 = hashlib.md5()
      #   Next we read in the file, blocksize bytes at a time, and feed it to md5
      #   we have to use the binary read option here
      with open(fname, 'rb') as f:
          while True:
              chunk = f.read(blocksize)
              #   If this is empty, then we have read the end of the file
              if not chunk:
                  break
              #   Tack the chunk onto the md5 object
              md5.update(chunk)
      #   Then, return the hexadecimal hash (this is the one that is transmitted
      #   through plain text)
      return md5.hexdigest()
code_tokens: def calculate_md5 ( fname , blocksize = 8192 ) : md5 = hashlib . md5 ( ) with open ( fname , 'rb' ) as f : while True : chunk = f . read ( blocksize ) if not chunk : break md5 . update ( chunk ) return md5 . hexdigest ( )
short_docstring: A helper function to calculate MD5 sums to make sure we grab files
  without corruption.
short_docstring_tokens: A helper function to calculate MD5 sums to make sure we grab files without corruption .
comment: """A helper function to calculate MD5 sums to make sure we grab files
      without corruption."""$SEP$#   If the supplied block size isn't a multiple of 128, then we will exit$SEP$#   with an error, since md5 has a digest block size of 128 bytes$SEP$#   Start the md5 digest object$SEP$#   Next we read in the file, blocksize bytes at a time, and feed it to md5$SEP$#   we have to use the binary read option here$SEP$#   If this is empty, then we have read the end of the file$SEP$#   Tack the chunk onto the md5 object$SEP$#   Then, return the hexadecimal hash (this is the one that is transmitted$SEP$#   through plain text)