code: def verify_checksum(self, data, checksum, filename):
          
          calculated_checksum = hashlib.sha256(data).hexdigest()
          logger.debug("calculated checksum {0} for {1}".format(calculated_checksum,
                                                                filename))
          if calculated_checksum != checksum:
              raise RepositoryError("{0}/{1}".format(self.url, filename),
                                    ("checksum verification failed, expected "
                                     "{0} got {1}".format(checksum,
                                                          calculated_checksum)))
docs: Verify sha256 checksum vs calculated checksum
  
          :type data: str
          :param data: data used to calculate checksum
          :type checksum: str
          :param checksum: expected checksum of data
          :type filename: str
          :param checksum: original filename