code: def __post_init__(self):
      if self.val is not None:
          # Already initialized
          return
  
      if not 0 < self.validation_split_ratio < 1:
          raise ValueError("validation_split_ratio must be in (0, 1)")
  
      # resolve all files so we can split them
      self.train.prepare_for_mode(PipelineMode.TRAINING)
      self.val = deepcopy(self.train)
      samples = len(self.train)
      n = int(self.validation_split_ratio * samples)
      if n == 0:
          raise ValueError(
              f"Ratio is to small since {self.validation_split_ratio} * {samples} = {n}. "
              f"Increase the amount of data or the split ratio."
          )
      logger.info(
          f"Splitting training and validation files with ratio {self.validation_split_ratio}: "
          f"{n}/{samples - n} for validation/training."
      )
      indices = list(range(samples))
      shuffle(indices)
  
      # split train and val img/gt files. Use train settings
      self.train.select(indices[n:])
      self.val.select(indices[:n])
  
file_path: calamari/calamari_ocr/ocr/training/pipeline_params.py
imports: from copy import deepcopy
  from dataclasses import dataclass, field
  from random import shuffle
  from typing import Optional
  import logging
  from paiargparse import pai_dataclass, pai_meta
  from tfaip import TrainerPipelineParams, TrainerPipelineParamsBase, PipelineMode
  from calamari_ocr.ocr.dataset.datareader.base import CalamariDataGeneratorParams
  from calamari_ocr.ocr.dataset.datareader.file import FileDataParams
  from calamari_ocr.ocr.dataset.datareader.pagexml.reader import PageXML
  from calamari_ocr.ocr.dataset.params import DATA_GENERATOR_CHOICES
label_desc: Use image node_id 1 for calling the CalamariSplitTrainerPipelineParams obj's underlying member method code with example usage: obj.__post_init__() without return types