code: def __init__(
      self,
      batch_size,
      data_shape,
      path_imgrec=None,
      shuffle=False,
      aug_list=None,
      rand_mirror=False,
      cutoff=0,
      ctx_num=0,
      images_per_identity=0,
      triplet_params=None,
      mx_model=None,
      data_name="data",
      label_name="softmax_label",
      **kwargs,
  ):
      super(FaceImageIter, self).__init__()
      assert path_imgrec
      assert shuffle
      logging.info("loading recordio %s...", path_imgrec)
      path_imgidx = path_imgrec[0:-4] + ".idx"
      self.imgrec = recordio.MXIndexedRecordIO(
          path_imgidx, path_imgrec, "r"
      )  # pylint: disable=redefined-variable-type
      s = self.imgrec.read_idx(0)
      header, _ = recordio.unpack(s)
      assert header.flag > 0
      print("header0 label", header.label)
      self.header0 = (int(header.label[0]), int(header.label[1]))
      # assert(header.flag==1)
      self.imgidx = range(1, int(header.label[0]))
      self.id2range = {}
      self.seq_identity = range(
          int(header.label[0]), int(header.label[1])
      )
      for identity in self.seq_identity:
          s = self.imgrec.read_idx(identity)
          header, _ = recordio.unpack(s)
          a, b = int(header.label[0]), int(header.label[1])
          self.id2range[identity] = (a, b)
  
      print("id2range", len(self.id2range))
      self.seq = self.imgidx
      print(len(self.seq))
  
      self.check_data_shape(data_shape)
      self.provide_data = [(data_name, (batch_size,) + data_shape)]
      self.batch_size = batch_size
      self.data_shape = data_shape
      self.shuffle = shuffle
      self.image_size = "%d,%d" % (data_shape[1], data_shape[2])
      self.rand_mirror = rand_mirror
      print("rand_mirror", rand_mirror)
      self.cutoff = cutoff
      # self.cast_aug = mx.image.CastAug()
      # self.color_aug = mx.image.ColorJitterAug(0.4, 0.4, 0.4)
      self.ctx_num = ctx_num
      self.per_batch_size = int(self.batch_size / self.ctx_num)
      self.images_per_identity = images_per_identity
      if self.images_per_identity > 0:
          self.identities = int(
              self.per_batch_size / self.images_per_identity
          )
          self.per_identities = self.identities
          self.repeat = 3000000.0 / (
              self.images_per_identity * len(self.id2range)
          )
          self.repeat = int(self.repeat)
          print(self.images_per_identity, self.identities, self.repeat)
      self.mx_model = mx_model
      self.triplet_params = triplet_params
      self.triplet_mode = False
      # self.provide_label = None
      self.provide_label = [(label_name, (batch_size,))]
      if self.triplet_params is not None:
          assert self.images_per_identity > 0
          assert self.mx_model is not None
          self.triplet_bag_size = self.triplet_params[0]
          self.triplet_alpha = self.triplet_params[1]
          self.triplet_max_ap = self.triplet_params[2]
          assert self.triplet_bag_size > 0
          assert self.triplet_alpha >= 0.0
          assert self.triplet_alpha <= 1.0
          self.triplet_mode = True
          self.triplet_cur = 0
          self.triplet_seq = []
          self.triplet_reset()
          self.seq_min_size = self.batch_size * 2
      self.cur = 0
      self.nbatch = 0
      self.is_init = False
      self.times = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import random
  import logging
  import sys
  import numbers
  import math
  import sklearn
  import datetime
  import numpy
  import cv2
  import mxnet
  from mxnet import ndarray
  from mxnet import io
  from mxnet import recordio
  import face_preprocess
label_desc: Use image node_id 1 to create a new FaceImageIter object from inherited base classes: io with example: obj = FaceImageIter(batch_size, data_shape, path_imgrec, shuffle, aug_list, rand_mirror, cutoff, ctx_num, images_per_identity, triplet_params, mx_model, data_name, label_name)