code: def read_list(path_in):
      """Reads the .lst file and generates corresponding iterator.
      Parameters
      ----------
      path_in: string
      Returns
      -------
      item iterator that contains information in .lst file
      """
      with open(path_in) as fin:
          while True:
              line = fin.readline()
              if not line:
                  break
              line = [i.strip() for i in line.strip().split("\t")]
              line_len = len(line)
              # check the data format of .lst file
              if line_len < 3:
                  print(
                      f"lst should have at least has three parts, but only has {line_len} parts for {line}"
                  )
                  continue
              try:
                  item = (
                      [int(line[0])]
                      + [line[-1]]
                      + [float(i) for i in line[1:-1]]
                  )
              except Exception as e:
                  print(
                      f"Parsing lst met error for {line}, detail: {e}"
                  )
                  continue
              yield item
  
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 4 for calling a global function with example usage: read_list(path_in) without return types