code: def analyze(self):
          
          from_date = self._out.latest_date()
          if from_date:
              logger.info("Reading items since " + from_date)
          else:
              logger.info("Reading items since the beginning of times")
  
          cont = 0
          total_processed = 0
          total_written = 0
  
          for item_block in self._in.read_block(size=self._block_size, from_date=from_date):
              cont = cont + len(item_block)
  
              process_results = self.process(item_block)
              total_processed += process_results.processed
  
              if len(process_results.out_items) > 0:
                  self._out.write(process_results.out_items)
                  total_written += len(process_results.out_items)
              else:
                  logger.info("No new items to be written this time.")
  
              logger.info(
                  "Items read/to be written/total read/total processed/total written: "
                  "{0}/{1}/{2}/{3}/{4}".format(str(len(item_block)),
                                               str(len(process_results.out_items)),
                                               str(cont),
                                               str(total_processed),
                                               str(total_written)))
  
          logger.info("SUMMARY: Items total read/total processed/total written: "
                      "{0}/{1}/{2}".format(str(cont),
                                           str(total_processed),
                                           str(total_written)))
  
          logger.info("This is the end.")
  
          return total_written
docs: Populate an enriched index by processing input items in blocks.
  
          :return: total number of out_items written.