'Generates converted values using given converter from given messages.
Groups values in batches of BATCH_SIZE size and applies the converter
to each batch.
Args:
converter: ExportConverter instance.
grr_messages: An iterable (a generator is assumed) with GRRMessage values.
Yields:
Values generated by the converter.
Raises:
ValueError: if any of the GrrMessage objects doesn\'t have "source" set.'

def _GenerateConvertedValues(self, converter, grr_messages):

    for batch in utils.Grouper(grr_messages, self.BATCH_SIZE):
        batch_with_metadata = []
        for grr_message in batch:
            if (not grr_message.source):
                raise ValueError("GrrMessage's    source    can't    be    empty")
            metadata = self.GetDefaultMetadata()
            metadata.client_urn = grr_message.source
            batch_with_metadata.append((metadata, grr_message.payload))
        for result in converter.BatchConvert(batch_with_metadata, token=self.token):
            (yield result)
