docstr: Returns the next batch of data.
docstr_tok: ["Returns","the","next","batch","of","data","."]
code: def next(self):
      """Returns the next batch of data."""
      # print('next')
      batch_size = self.batch_size
      batch_data = nd.empty((batch_size,) + self.data_shape)
      batch_label = nd.empty((batch_size,) + self.label_shape)
      i = 0
      # self.cutoff = random.randint(800,1280)
      try:
          while i < batch_size:
              # print('N', i)
              data, label, annot = self.next_sample()
              R = self.get_data(data, label, annot)
              if R is None:
                  continue
              data_out, label_out, flip_data_out, flip_label_out = R
              if not self.use_coherent:
                  data = nd.array(data_out)
                  data = nd.transpose(data, axes=(2, 0, 1))
                  label = nd.array(label_out)
                  # print(data.shape, label.shape)
                  batch_data[i][:] = data
                  batch_label[i][:] = label
                  i += 1
              else:
                  data = nd.array(data_out)
                  data = nd.transpose(data, axes=(2, 0, 1))
                  label = nd.array(label_out)
                  data2 = nd.array(flip_data_out)
                  data2 = nd.transpose(data2, axes=(2, 0, 1))
                  label2 = nd.array(flip_label_out)
                  # M = nd.array(M)
                  # print(data.shape, label.shape)
                  batch_data[i][:] = data
                  batch_label[i][:] = label
                  # i+=1
                  j = i + self.per_batch_size // 2
                  batch_data[j][:] = data2
                  batch_label[j][:] = label2
                  i += 1
                  if j % self.per_batch_size == self.per_batch_size - 1:
                      i = j + 1
      except StopIteration:
          if i < batch_size:
              raise StopIteration
  
      # return {self.data_name  :  batch_data,
      #        self.label_name :  batch_label}
      # print(batch_data.shape, batch_label.shape)
      return mx.io.DataBatch(
          [batch_data], [batch_label], batch_size - i
      )
  
imports: import mxnet
  import numpy
  import sys, os
  import random
  import math
  import scipy.misc
  import cv2
  import logging
  import sklearn
  import datetime
  import img_helper
  from mxnet.io import DataIter
  from mxnet import ndarray
  from mxnet import io
  from mxnet import recordio
  from PIL import Image
  from config import config
  from skimage import transform
label_desc: Use image node_id 9 for calling the FaceSegIter obj's underlying member method code with example usage: obj.next() and returns: mx