def METHOD_NAME(self):
    if self.batch_by_size:
        order = [
            np.arange(len(self)),
            self.sizes,
        ]  # No need to handle `self.shuffle == True`
        return np.lexsort(order)
    else:
        return np.arange(len(self))