code: def _assertsanity(self):
          
          assert self.len >= 0
          assert 0 <= self._offset, "offset={0}".format(self._offset)
          assert (self.len + self._offset + 7) // 8 == self._datastore.bytelength + self._datastore.byteoffset
          return True
docs: Check internal self consistency as a debugging aid.