code: def test_kiepage():
      page = np.zeros((300, 200, 3), dtype=np.uint8)
      page_idx = 0
      page_size = (300, 200)
      orientation = {"value": 0.0, "confidence": 0.0}
      language = {"value": "EN", "confidence": 0.8}
      predictions = {CLASS_NAME: _mock_prediction()}
      kie_page = elements.KIEPage(
          page, predictions, page_idx, page_size, orientation, language
      )
  
      # Attribute checks
      assert len(kie_page.predictions) == len(predictions)
      assert all(
          isinstance(b, elements.Prediction)
          for b in kie_page.predictions[CLASS_NAME]
      )
      assert isinstance(kie_page.page, np.ndarray)
      assert kie_page.page_idx == page_idx
      assert kie_page.dimensions == page_size
      assert kie_page.orientation == orientation
      assert kie_page.language == language
  
      # Render
      assert kie_page.render() == "words: hello\n\nwords: world"
  
      # Export
      assert kie_page.export() == {
          "predictions": {
              CLASS_NAME: [b.export() for b in predictions[CLASS_NAME]]
          },
          "page_idx": page_idx,
          "dimensions": page_size,
          "orientation": orientation,
          "language": language,
      }
  
      # Export XML
      assert (
          isinstance(kie_page.export_as_xml(), tuple)
          and isinstance(
              kie_page.export_as_xml()[0], (bytes, bytearray)
          )
          and isinstance(kie_page.export_as_xml()[1], ElementTree)
      )
  
      # Repr
      assert (
          "\n".join(repr(kie_page).split("\n")[:2])
          == f"KIEPage(\n  dimensions={page_size!r}"
      )
  
      # Show
      kie_page.show(block=False)
  
      # Synthesize
      img = kie_page.synthesize()
      assert isinstance(img, np.ndarray)
      assert img.shape == (*page_size, 3)
  
imports: from xml.etree.ElementTree import ElementTree
  import numpy
  import pytest
  from doctr.file_utils import CLASS_NAME
  from doctr.io import elements
label_desc: Use image node_id 15 for calling a global function with example usage: test_kiepage() without return types