code: def genDetRecTrainVal(args):
      detAbsTrainRootPath = isCreateOrDeleteFolder(
          args.detRootPath, "train"
      )
      detAbsValRootPath = isCreateOrDeleteFolder(
          args.detRootPath, "val"
      )
      detAbsTestRootPath = isCreateOrDeleteFolder(
          args.detRootPath, "test"
      )
      recAbsTrainRootPath = isCreateOrDeleteFolder(
          args.recRootPath, "train"
      )
      recAbsValRootPath = isCreateOrDeleteFolder(
          args.recRootPath, "val"
      )
      recAbsTestRootPath = isCreateOrDeleteFolder(
          args.recRootPath, "test"
      )
  
      removeFile(os.path.join(args.detRootPath, "train.txt"))
      removeFile(os.path.join(args.detRootPath, "val.txt"))
      removeFile(os.path.join(args.detRootPath, "test.txt"))
      removeFile(os.path.join(args.recRootPath, "train.txt"))
      removeFile(os.path.join(args.recRootPath, "val.txt"))
      removeFile(os.path.join(args.recRootPath, "test.txt"))
  
      detTrainTxt = open(
          os.path.join(args.detRootPath, "train.txt"),
          "a",
          encoding="UTF-8",
      )
      detValTxt = open(
          os.path.join(args.detRootPath, "val.txt"),
          "a",
          encoding="UTF-8",
      )
      detTestTxt = open(
          os.path.join(args.detRootPath, "test.txt"),
          "a",
          encoding="UTF-8",
      )
      recTrainTxt = open(
          os.path.join(args.recRootPath, "train.txt"),
          "a",
          encoding="UTF-8",
      )
      recValTxt = open(
          os.path.join(args.recRootPath, "val.txt"),
          "a",
          encoding="UTF-8",
      )
      recTestTxt = open(
          os.path.join(args.recRootPath, "test.txt"),
          "a",
          encoding="UTF-8",
      )
  
      splitTrainVal(
          args.datasetRootPath,
          detAbsTrainRootPath,
          detAbsValRootPath,
          detAbsTestRootPath,
          detTrainTxt,
          detValTxt,
          detTestTxt,
          "det",
      )
  
      for root, dirs, files in os.walk(args.datasetRootPath):
          for dir in dirs:
              if dir == "crop_img":
                  splitTrainVal(
                      root,
                      recAbsTrainRootPath,
                      recAbsValRootPath,
                      recAbsTestRootPath,
                      recTrainTxt,
                      recValTxt,
                      recTestTxt,
                      "rec",
                  )
              else:
                  continue
          break
  
file_path: PaddleOCR/PPOCRLabel/gen_ocr_train_val_test.py
imports: import os
  import shutil
  import random
  import argparse
label_desc: Use image node_id 4 for calling a global function with example usage: genDetRecTrainVal(args) without return types