code: def write_list(path_out, image_list):
      """Hepler function to write image list into the file.
      The format is as below,
      integer_image_index \t float_label_index \t path_to_image
      Note that the blank between number and tab is only used for readability.
      Parameters
      ----------
      path_out: string
      image_list: list
      """
      with open(path_out, "w") as fout:
          for i, item in enumerate(image_list):
              line = f"{item[0]}\t"
              for j in item[2:]:
                  line += f"{j}\t"
              line += f"{item[1]}\n"
              fout.write(line)
  
file_path: mxnet/tools/im2rec.py
imports: from __future__ import print_function
  import os
  import sys
  import mxnet
  import random
  import argparse
  import cv2
  import time
  import traceback
label_desc: Use image node_id 2 for calling a global function with example usage: write_list(path_out, image_list) without return types