code: def test_document():
      pages = _mock_pages()
      doc = elements.Document(pages)
  
      # Attribute checks
      assert len(doc.pages) == len(pages)
      assert all(isinstance(p, elements.Page) for p in doc.pages)
  
      # Render
      page_export = (
          "hello world\nhello world\n\nhello world\nhello world"
      )
      assert doc.render() == f"{page_export}\n\n\n\n{page_export}"
  
      # Export
      assert doc.export() == {"pages": [p.export() for p in pages]}
  
      # Export XML
      assert isinstance(doc.export_as_xml(), list) and len(
          doc.export_as_xml()
      ) == len(pages)
  
      # Show
      doc.show(block=False)
  
      # Synthesize
      img_list = doc.synthesize()
      assert isinstance(img_list, list) and len(img_list) == len(pages)
  
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 16 for calling a global function with example usage: test_document() without return types