code: def _bounding_rect_from_points(
      points: List[Tuple[int, int]]
  ) -> Tuple[int, int, int, int]:
      min_x, min_y = math.inf, math.inf
      max_x, max_y = -math.inf, -math.inf
  
      for x, y in points:
          if x < min_x:
              min_x = x
          if y < min_y:
              min_y = y
          if x > max_x:
              max_x = x
          if y > max_y:
              max_y = y
  
      width, height = max_x - min_x, max_y - min_y
      return min_x, min_y, width, height
  
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 8 for calling the PageXMLReader obj's underlying member method code with example usage: obj._bounding_rect_from_points(points) and returns: min_x,  min_y,  width,  height