def next(self):
    'For python 2.x.\n\n        # Returns\n            The next batch.\n        '
    with self.lock:
        index_array = next(self.index_generator)
    return self._get_batches_of_transformed_samples(index_array)
For python 2.x.

# Returns
    The next batch.
def next(self):
    'For python 2.x.\n\n        # Returns\n            The next batch.\n        '
    with self.lock:
        index_array = next(self.index_generator)
    return self._get_batches_of_transformed_samples(index_array)