code: def read_worker(args, q_in):
      path_imgidx = os.path.join(args.input, "train.idx")
      path_imgrec = os.path.join(args.input, "train.rec")
      imgrec = mx.recordio.MXIndexedRecordIO(
          path_imgidx, path_imgrec, "r"
      )
  
      s = imgrec.read_idx(0)
      header, _ = mx.recordio.unpack(s)
      assert header.flag > 0
  
      imgidx = np.array(range(1, int(header.label[0])))
      np.random.shuffle(imgidx)
  
      for idx in imgidx:
          item = imgrec.read_idx(idx)
          q_in.put(item)
  
      q_in.put(None)
      imgrec.close()
  
file_path: insightface/recognition/arcface_torch/scripts/shuffle_rec.py
imports: import argparse
  import multiprocessing
  import os
  import time
  import mxnet
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: read_worker(args, q_in) without return types