code: def train_individual_model(run_args):
      # Call the training script with the json file as args
      # The json file contains all training parameters, including the files for training and validation
      # Note: It is necessary to launch a new thread because the command might be prefixed (e. g. use slurm as job
      #       scheduler to train all folds on different machines
      args = run_args["args"]
      train_args_json = run_args["json"]
      fold_logger = logging.getLogger(f"FOLD {run_args['id']}")
      for handler in fold_logger.handlers:
          handler.terminator = ""
  
      for out, err in run(
          prefix_run_command(
              [
                  sys.executable,
                  "-u",
                  run_args["train_script"],
                  train_args_json,
              ],
              run_args.get("run", None),
              {"threads": run_args.get("num_threads", -1)},
          ),
          verbose=run_args.get("verbose", False),
      ):
          # Print the output of the thread
          if run_args.get("verbose", False):
              if out:
                  fold_logger.info(out.rstrip("\n"))
              if err:
                  fold_logger.info(err.rstrip("\n"))
  
      return args
  
imports: import inspect
  import json
  import logging
  import multiprocessing
  import os
  import sys
  import tempfile
  from copy import deepcopy
  from dataclasses import dataclass, field
  from subprocess import check_call
  from typing import Optional, List
  from paiargparse import pai_dataclass, pai_meta
  from tfaip.util.tfaipargparse import post_init
  from calamari_ocr.ocr import CrossFold, SavedCalamariModel
  from calamari_ocr.ocr.dataset.datareader.hdf5.reader import Hdf5
  from calamari_ocr.ocr.scenario import CalamariScenario
  from calamari_ocr.ocr.training.params import TrainerParams, CalamariDefaultTrainerPipelineParams
  from calamari_ocr.utils.multiprocessing import prefix_run_command, run
label_desc: Use image node_id 1 for calling a global function with example usage: train_individual_model(run_args) and returns: args