code: def main():
      args = parse_args()
  
      (
          result_csv,
          fail,
          fail_num,
          none_exist,
          none_exist_num,
          latest_time,
      ) = write_csv("rf100/", args)
  
      os.rename(result_csv, latest_time + "_eval.csv")
      result_csv = latest_time + "_eval.csv"
  
      # write excel in the order of execution
      if args.origin:
          df = pd.read_csv(result_csv)
          result_xlsx_detail = "{}_origin.xlsx".format(latest_time)
          if os.path.exists(result_xlsx_detail):
              os.remove(result_xlsx_detail)
          print(f"\n{result_xlsx_detail} created!\n")
          df.to_excel(result_xlsx_detail)
          wb_align(result_xlsx_detail, [["E1", "F1"], ["G1", "K1"]])
  
      # write excel in the order of category&dataset name
      result_xlsx_sort = "{}_detail.xlsx".format(latest_time)
      result_xlsx_sum = "{}_sum.xlsx".format(latest_time)
      if os.path.exists(result_xlsx_sum):
          os.remove(result_xlsx_sum)
  
      # sortec by category name
      sort_excel(result_csv, result_xlsx_sort)
      wb_align(result_xlsx_sort, [["D1", "E1"], ["F1", "J1"]])
  
      # sum of each category
      sum_excel(result_csv, result_xlsx_sum)
      wb_align(
          result_xlsx_sum,
          [
              ["A1", "A2"],
              ["B1", "B2"],
              ["C1", "C2"],
              ["D1", "E1"],
              ["F1", "J1"],
          ],
      )
  
      # save fail
      print(f"sum_file = {result_xlsx_sum}")
      """ generate .txt file """
      print(
          f"{none_exist_num} datasets were not trained:\n{none_exist}\n"
      )
      print(f"{fail_num} training failed:\n{fail}\n")
  
      fail_txt = os.path.join(args.work_dirs, "failed_dataset_list.txt")
      with open(fail_txt, "w") as f:
          pass
      with open(fail_txt, "a") as f:
          for item in none_exist:
              f.write(f"{item}\n")
          for item in fail:
              f.write(f"{item}\n")
  
      print(
          f"all {fail_num + none_exist_num} untrained datasets "
          f"have been logged in {fail_txt}!"
      )
  
file_path: mmdetection/projects/RF100-Benchmark/scripts/log_extract.py
imports: import argparse
  import csv
  import json
  import os
  import re
  import numpy
  import pandas
  from openpyxl import load_workbook
  from openpyxl.styles import Alignment
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types