code: def default_trainer_params(with_validation=False, preload=True):
      p = CalamariTestScenario.default_trainer_params()
      train = Hdf5(
          files=[
              os.path.join(
                  this_dir, "data", "uw3_50lines", "uw3-50lines.h5"
              )
          ],
          preload=preload,
      )
      if with_validation:
          p.gen.val = Hdf5(
              files=[
                  os.path.join(
                      this_dir, "data", "uw3_50lines", "uw3-50lines.h5"
                  )
              ],
              preload=preload,
          )
          p.gen.train = train
          p.gen.__post_init__()
      else:
          p.gen = CalamariTrainOnlyPipelineParams(train=train)
  
      p.gen.setup.val.batch_size = 1
      p.gen.setup.val.num_processes = 1
      p.gen.setup.train.batch_size = 1
      p.gen.setup.train.num_processes = 1
      p.epochs = 1
      p.samples_per_epoch = 2
      p.scenario.data.__post_init__()
      p.scenario.__post_init__()
      p.__post_init__()
      return p
  
imports: import os
  import tempfile
  import unittest
  from tensorflow import keras
  from tfaip.data.pipeline.processor.params import SequentialProcessorPipelineParams
  from calamari_ocr.ocr.dataset.datareader.hdf5.reader import Hdf5
  from calamari_ocr.ocr.dataset.imageprocessors import PrepareSampleProcessorParams
  from calamari_ocr.ocr.training.pipeline_params import CalamariTrainOnlyPipelineParams
  from calamari_ocr.scripts.train import main
  from calamari_ocr.test.calamari_test_scenario import CalamariTestScenario
label_desc: Use image node_id 1 for calling a global function with example usage: default_trainer_params(with_validation, preload) and returns: p