code: def run(self, records):
          
          self_name = type(self).__name__
          for i, batch in enumerate(grouper(records, self.BATCH_SIZE, skip_missing=True), 1):
              self.logger.info('%s processing batch %d', self_name, i)
              try:
                  for j, proc_batch in enumerate(grouper(
                          process_records(batch).iteritems(), self.BATCH_SIZE, skip_missing=True), 1):
                      self.logger.info('%s uploading chunk #%d (batch %d)', self_name, j, i)
                      self.upload_records({k: v for k, v in proc_batch}, from_queue=True)
              except Exception:
                  self.logger.exception('%s could not upload batch', self_name)
                  return
              self.logger.info('%s finished batch %d', self_name, i)
              self.processed_records(batch)
          self.logger.info('%s finished', self_name)
docs: Runs the batch upload
  
          :param records: an iterable containing queue entries