code: def prepare_for_mode(self, mode: PipelineMode):
      logger.info("Resolving input files")
      input_image_files = sorted(glob_all(self.images))
  
      if not self.texts:
          gt_txt_files = [
              split_all_ext(f)[0] + self.gt_extension
              for f in input_image_files
          ]
      else:
          gt_txt_files = sorted(glob_all(self.texts))
          if mode in INPUT_PROCESSOR:
              (
                  input_image_files,
                  gt_txt_files,
              ) = keep_files_with_same_file_name(
                  input_image_files, gt_txt_files
              )
              for img, gt in zip(input_image_files, gt_txt_files):
                  if (
                      split_all_ext(os.path.basename(img))[0]
                      != split_all_ext(os.path.basename(gt))[0]
                  ):
                      raise Exception(
                          f"Expected identical basenames of file: {img} and {gt}"
                      )
          else:
              input_image_files = None
  
      if mode in {PipelineMode.TRAINING, PipelineMode.EVALUATION}:
          if len(set(gt_txt_files)) != len(gt_txt_files):
              logger.warning(
                  "Some ground truth text files occur more than once in the data set "
                  "(ignore this warning, if this was intended)."
              )
          if len(set(input_image_files)) != len(input_image_files):
              logger.warning(
                  "Some images occur more than once in the data set. "
                  "This warning should usually not be ignored."
              )
  
      self.images = input_image_files
      self.texts = gt_txt_files
  
imports: import codecs
  import os
  from copy import deepcopy
  from dataclasses import dataclass, field
  from typing import List
  import numpy
  import logging
  from paiargparse import pai_dataclass, pai_meta
  from tfaip.data.pipeline.definitions import PipelineMode, INPUT_PROCESSOR
  from calamari_ocr.ocr.dataset.datareader.base import CalamariDataGenerator, CalamariDataGeneratorParams, InputSample, SampleMeta
  from calamari_ocr.utils import split_all_ext, glob_all, keep_files_with_same_file_name
label_desc: Use image node_id 5 for calling the FileDataParams obj's underlying member method code with example usage: obj.prepare_for_mode(mode) without return types