<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_batch(self, batch):
 """ Receives the batch, filters it, and returns it. """

        for item in batch:
            if self.filter(item):
                yield item
            else:
                self.set_metadata('filtered_out',
                                  self.get_metadata('filtered_out') + 1)

            self.total += 1
            self._log_progress()