def process_batches(self):
for key, batch in iteritems(self._batches):<EOL><INDENT>self._current_tups = batch<EOL>self._current_key = key<EOL>self.process_batch(key, batch)<EOL>if self.auto_ack:<EOL><INDENT>for tup in batch:<EOL><INDENT>self.ack(tup)<EOL><DEDENT><DEDENT>self._current_key = None<EOL>self._batches[key] = []<EOL><DEDENT>self._batches = defaultdict(list)<EOL>
Iterate through all batches, call process_batch on them, and ack.

        Separated out for the rare instances when we want to subclass
        BatchingBolt and customize what mechanism causes batches to be
        processed.