code: def make_list(exdir):
      train_dir = osp.join(exdir, "bounding_box_train")
      train_list = {}
      for _, _, files in walk(train_dir, topdown=False):
          for name in files:
              if ".jpg" in name:
                  name_split = name.split("_")
                  pid = name_split[0]
                  pcam = name_split[1][1]
                  if pid not in train_list:
                      train_list[pid] = []
                  train_list[pid].append(
                      {"name": name, "pid": pid, "pcam": pcam}
                  )
  
      with open(osp.join(exdir, "train.txt"), "w") as f:
          for i, key in enumerate(train_list):
              for item in train_list[key]:
                  f.write(
                      item["name"]
                      + " "
                      + str(i)
                      + " "
                      + item["pcam"]
                      + "\n"
                  )
      print("Make Label List Done")
  
file_path: gluon-cv/scripts/datasets/market1501.py
imports: from __future__ import print_function, division
  import json
  import argparse
  from os import walk
  from os import path
  from zipfile import ZipFile
  from gluoncv.utils import download, makedirs
label_desc: Use image node_id 3 for calling a global function with example usage: make_list(exdir) without return types