code: def prepare_for_mode(self, mode: PipelineMode):
      self.images = sorted(glob_all(self.images))
      self.xml_files = sorted(glob_all(self.xml_files))
      if not self.xml_files:
          self.xml_files = [
              split_all_ext(f)[0] + self.gt_extension
              for f in self.images
          ]
      if not self.images:
          self.images = [None] * len(self.xml_files)
  
      if len(self.images) != len(self.xml_files):
          raise ValueError(
              f"Different number of image and xml files, {len(self.images)} != {len(self.xml_files)}"
          )
      for img_path, xml_path in zip(self.images, self.xml_files):
          if img_path and xml_path:
              img_bn, xml_bn = (
                  split_all_ext(img_path)[0],
                  split_all_ext(xml_path)[0],
              )
              if img_bn != xml_bn:
                  logger.warning(
                      f"Filenames are not matching, got base names \n  image: {img_bn}\n  xml:   {xml_bn}\n."
                  )
  
imports: import logging
  from copy import deepcopy
  from dataclasses import dataclass, field
  from typing import List, Generator
  import numpy
  from paiargparse import pai_dataclass, pai_meta
  from tfaip.data.pipeline.definitions import PipelineMode, TARGETS_PROCESSOR, INPUT_PROCESSOR
  from tqdm import tqdm
  from calamari_ocr.ocr.dataset.datareader.abbyy.xml import XMLReader, XMLWriter
  from calamari_ocr.ocr.dataset.datareader.base import CalamariDataGenerator, CalamariDataGeneratorParams, InputSample, SampleMeta
  from calamari_ocr.utils import split_all_ext, glob_all
label_desc: Use image node_id 5 for calling the Abbyy obj's underlying member method code with example usage: obj.prepare_for_mode(mode) without return types