def _compute_chip_erase_pages_and_weight(self):
        chip_erase_count = 0
        chip_erase_weight = 0
        chip_erase_weight += self.flash.getFlashInfo().erase_weight
        for page in self.page_list:
            if page.erased is None:
                page.erased = _erased(page.data)
            if not page.erased:
                chip_erase_count += 1
                chip_erase_weight += page.getProgramWeight()
        self.chip_erase_count = chip_erase_count
        self.chip_erase_weight = chip_erase_weight
        return chip_erase_count, chip_erase_weight
Compute the number of erased pages.
dataset/ETHPy150Open mbedmicro/pyOCD/pyOCD/flash/flash_builder.py/FlashBuilder._compute_chip_erase_pages_and_weight