code: def load(self, img, xml) -> Iterable[Dict[str, Any]]:
      if not os.path.exists(xml):
          if self.skip_invalid:
              logger.warning(
                  f"File '{xml}' does not exist. Skipping since `skip_invalid=True`."
              )
              return []
          else:
              raise FileNotFoundError(f"File '{xml}' does not exist.")
  
      # remove_blank_text=True is needed so we can add tags to the tree without the pretty printer breaking
      parser = etree.XMLParser(remove_blank_text=True)
      root = etree.parse(xml, parser).getroot()
      self.root = root
  
      page_id = split_all_ext(xml)[0]
      if self.mode in TARGETS_PROCESSOR:
          return self._samples_gt_from_book(root, img, page_id)
      else:
          return self._samples_from_book(root, img, page_id)
  
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 2 for calling the PageXMLDatasetLoader obj's underlying member method code with example usage: obj.load(img, xml) and returns: self, self, list