code: def calculate_data_txt(txt_path, dataset_dir):
      # create my_data.txt file that record image list
      with open(txt_path, "w") as w:
          for file_name in os.listdir(dataset_dir):
              if file_name == "classes.txt":
                  continue
  
              img_path = (
                  os.path.join(
                      dataset_dir.replace("labels", "images"),
                      file_name.split(".")[0],
                  )
                  + ".jpg"
              )
              line = img_path + "\n"
              assert os.path.exists(
                  img_path
              ), "file:{} not exist!".format(img_path)
              w.write(line)
  
imports: import os
label_desc: Use image node_id 1 for calling a global function with example usage: calculate_data_txt(txt_path, dataset_dir) without return types