code: def get_docinfo(base_pdf: Pdf, context: PdfContext) -> dict[str, str]:
      """Read the document info and store it in a dictionary."""
      options = context.options
  
      def from_document_info(key):
          try:
              s = base_pdf.docinfo[key]
              return str(s)
          except (KeyError, TypeError):
              return ""
  
      pdfmark = {
          k: from_document_info(k)
          for k in (
              "/Title",
              "/Author",
              "/Keywords",
              "/Subject",
              "/CreationDate",
          )
      }
      if options.title:
          pdfmark["/Title"] = options.title
      if options.author:
          pdfmark["/Author"] = options.author
      if options.keywords:
          pdfmark["/Keywords"] = options.keywords
      if options.subject:
          pdfmark["/Subject"] = options.subject
  
      creator_tag = (
          context.plugin_manager.hook.get_ocr_engine().creator_tag(
              options
          )
      )
  
      pdfmark[
          "/Creator"
      ] = f"{PROGRAM_NAME} {OCRMYPF_VERSION} / {creator_tag}"
      pdfmark["/Producer"] = f"pikepdf {PIKEPDF_VERSION}"
      pdfmark["/ModDate"] = encode_pdf_date(datetime.now(timezone.utc))
      return pdfmark
  
imports: from __future__ import annotations
  import logging
  import os
  from datetime import datetime, timezone
  from pathlib import Path
  from typing import Any
  from pikepdf import Dictionary, Name, Pdf
  from pikepdf import __version__
  from pikepdf.models.metadata import PdfMetadata, encode_pdf_date
  from ocrmypdf._jobcontext import PdfContext
  from ocrmypdf._version import PROGRAM_NAME
  from ocrmypdf._version import __version__
  from ocrmypdf.languages import iso_639_2_from_3
label_desc: Use image node_id 1 for calling a global function with example usage: get_docinfo(base_pdf, context) and returns: pdfmark, str, str