code: def __init__(
      self,
      mode: PipelineMode,
      params: PageXML,
  ):
      super().__init__(mode, params)
      self.pages = {}
      for img, xml in zip(params.images, params.xml_files):
          loader = PageXMLDatasetLoader(
              self.mode,
              params.non_existing_as_empty,
              params.text_index,
              params.skip_invalid,
              params.skip_commented,
          )
          for sample in loader.load(img, xml):
              self.add_sample(sample)
  
          self.pages[split_all_ext(xml)[0]] = loader.root
  
      # store which pagexml was stored last, to check when a file is ready to be written during sequential prediction
      self._last_page_id = None
  
      # counter for word tag ids
      self._next_word_id = 0
  
imports: import os
  from copy import deepcopy
  from dataclasses import dataclass, field
  from random import shuffle
  import math
  import numpy
  from paiargparse import pai_dataclass, pai_meta
  from tfaip.data.pipeline.definitions import PipelineMode, INPUT_PROCESSOR, TARGETS_PROCESSOR
  from tqdm import tqdm
  from lxml import etree
  import cv2
  from typing import List, Generator, Optional, Iterable, Dict, Any, Tuple
  from enum import IntEnum
  from calamari_ocr.ocr.dataset.datareader.base import CalamariDataGenerator, CalamariDataGeneratorParams, InputSample, SampleMeta
  from calamari_ocr.utils import split_all_ext, filename, glob_all
  from calamari_ocr.ocr.predict.params import Prediction
  import logging
label_desc: Use image node_id 1 to create a new PageXMLReader object from inherited base classes: CalamariDataGenerator with example: obj = PageXMLReader(mode, params)