parameters: (tar_gz_filename, md5_url)
docstring: Performs checksum verification of downloaded release file
docstring_summary: Performs checksum verification of downloaded release file
docstring_tokens: Performs checksum verification of downloaded release file
function: def verify(tar_gz_filename, md5_url):
      """
      Performs checksum verification of downloaded release file
      """
  
      if filename != tar_gz_filename:
          raise VerificationError(
              "External MD5 appears to be for a different file. Was {} expected {}".format(
                  filename, tar_gz_filename
              )
          )
  
      print("Verifying checksum")
      local_md5 = hashlib.md5()
      with open(filename, "rb") as f:
          # Read in chunks to avoid reading the whole file into memory
          for chunk in iter(lambda: f.read(4096), b""):
              local_md5.update(chunk)
  
      if local_md5.hexdigest() != external_md5:
          raise ChecksumError(
              "Checksum mismatch! Local {} expected {}".format(local_md5.hexdigest(), external_md5)
          )
      print("OK")
function_tokens: def verify ( tar_gz_filename , md5_url ) : if filename != tar_gz_filename : raise VerificationError ( "External MD5 appears to be for a different file. Was {} expected {}" . format ( filename , tar_gz_filename ) ) print ( "Verifying checksum" ) local_md5 = hashlib . md5 ( ) with open ( filename , "rb" ) as f : # Read in chunks to avoid reading the whole file into memory for chunk in iter ( lambda : f . read ( 4096 ) , b"" ) : local_md5 . update ( chunk ) if local_md5 . hexdigest ( ) != external_md5 : raise ChecksumError ( "Checksum mismatch! Local {} expected {}" . format ( local_md5 . hexdigest ( ) , external_md5 ) ) print ( "OK" )