class_docstr: This class can read Abbyy documents out of a directory
code: def requireAttr(node, attrs):
      a = {}
      for attr in attrs:
          a[attr] = node.get(attr)
          if a[attr] is None:
              raise XMLParseError(
                  "Missing required attribute {} on node {}".format(
                      attr, node
                  )
              )
  
      return a
  
file_path: calamari/calamari_ocr/ocr/dataset/datareader/abbyy/xml/reader.py
imports: import os
  from lxml import etree
  from .data import Book, Page, Block, Format, Line, Par, Rect
  from .exceptions import XMLParseError
  from tqdm import tqdm
  import logging
label_desc: Use image node_id 4 for calling the XMLReader obj's underlying member method code with example usage: obj.requireAttr(node, attrs) and returns: a