code: def get_data_rec(
      rec_train,
      rec_train_idx,
      rec_val,
      rec_val_idx,
      batch_size,
      num_workers,
      input_size,
      crop_ratio,
  ):
      rec_train = os.path.expanduser(rec_train)
      rec_train_idx = os.path.expanduser(rec_train_idx)
      rec_val = os.path.expanduser(rec_val)
      rec_val_idx = os.path.expanduser(rec_val_idx)
      jitter_param = 0.4
      lighting_param = 0.1
      input_size = input_size
      crop_ratio = crop_ratio if crop_ratio > 0 else 0.875
      resize = int(math.ceil(input_size / crop_ratio))
      mean_rgb = [123.68, 116.779, 103.939]
      std_rgb = [58.393, 57.12, 57.375]
  
      train_data = mx.io.ImageRecordIter(
          path_imgrec=rec_train,
          path_imgidx=rec_train_idx,
          preprocess_threads=num_workers,
          shuffle=True,
          batch_size=batch_size,
          data_shape=(3, input_size, input_size),
          mean_r=mean_rgb[0],
          mean_g=mean_rgb[1],
          mean_b=mean_rgb[2],
          std_r=std_rgb[0],
          std_g=std_rgb[1],
          std_b=std_rgb[2],
          rand_mirror=True,
          random_resized_crop=True,
          max_aspect_ratio=4.0 / 3.0,
          min_aspect_ratio=3.0 / 4.0,
          max_random_area=1,
          min_random_area=0.08,
          brightness=jitter_param,
          saturation=jitter_param,
          contrast=jitter_param,
          pca_noise=lighting_param,
      )
      val_data = mx.io.ImageRecordIter(
          path_imgrec=rec_val,
          path_imgidx=rec_val_idx,
          preprocess_threads=num_workers,
          shuffle=False,
          batch_size=batch_size,
          resize=resize,
          data_shape=(3, input_size, input_size),
          mean_r=mean_rgb[0],
          mean_g=mean_rgb[1],
          mean_b=mean_rgb[2],
          std_r=std_rgb[0],
          std_g=std_rgb[1],
          std_b=std_rgb[2],
      )
      return train_data, val_data, rec_batch_fn
  
file_path: gluon-cv/gluoncv/auto/estimators/image_classification/utils.py
imports: import os
  import math
  import mxnet
  from mxnet import nd
  from mxnet import gluon
  from mxnet.gluon.data.vision import transforms
  from ....data import imagenet
label_desc: Use image node_id 2 for calling a global function with example usage: get_data_rec(rec_train, rec_train_idx, rec_val, rec_val_idx, batch_size, num_workers, input_size, crop_ratio) and returns: train_data,  val_data,  rec_batch_fn