'Verify the checksum/datasum values if the cards exist in the header.
Simply displays warnings if either the checksum or datasum don\'t match.'

def _verify_checksum_datasum(self, blocking):

    if ('CHECKSUM' in self._header):
        self._checksum = self._header['CHECKSUM']
        self._checksum_comment = self._header.comments['CHECKSUM']
        if (not self.verify_checksum(blocking)):
            warnings.warn('Checksum    verification    failed    for    HDU    {0}.\n'.format((self.name, self.ver)), AstropyUserWarning)
    else:
        self._checksum = None
        self._checksum_comment = None
    if ('DATASUM' in self._header):
        self._datasum = self._header['DATASUM']
        self._datasum_comment = self._header.comments['DATASUM']
        if (not self.verify_datasum(blocking)):
            warnings.warn('Datasum    verification    failed    for    HDU    {0}.\n'.format((self.name, self.ver)), AstropyUserWarning)
    else:
        self._checksum = None
        self._checksum_comment = None
        self._datasum = None
        self._datasum_comment = None
