code: def _fix_metadata(meta_original: PdfMetadata, meta_pdf: PdfMetadata):
      # If xmp:CreateDate is missing, set it to the modify date to
      # ensure consistency with Ghostscript.
      if "xmp:CreateDate" not in meta_pdf:
          meta_pdf["xmp:CreateDate"] = meta_pdf.get(
              "xmp:ModifyDate", ""
          )
      if meta_pdf.get("dc:title") == "Untitled":
          # Ghostscript likes to set title to Untitled if omitted from input.
          # Reverse this, because PDF/A TechNote 0003:Metadata in PDF/A-1
          # and the XMP Spec do not make this recommendation.
          if "dc:title" not in meta_original:
              del meta_pdf["dc:title"]
  
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 5 for calling a global function with example usage: _fix_metadata(meta_original, meta_pdf) without return types