code: def test_override_metadata(output_type, resources, outpdf, caplog):
      input_file = resources / "c02-22.pdf"
      german = "Du siehst den Wald vor lauter Bäumen nicht."
      chinese = "孔子"
  
      exitcode = run_ocrmypdf_api(
          input_file,
          outpdf,
          "--title",
          german,
          "--author",
          chinese,
          "--output-type",
          output_type,
          "--plugin",
          "tests/plugins/tesseract_noop.py",
      )
  
      assert exitcode == ExitCode.ok, caplog.text
  
      with pikepdf.open(input_file) as before, pikepdf.open(
          outpdf
      ) as after:
          assert after.docinfo.Title == german, after.docinfo
          assert after.docinfo.Author == chinese, after.docinfo
          assert after.docinfo.get("/Keywords", "") == ""
  
          before_date = decode_pdf_date(
              str(before.docinfo.CreationDate)
          )
          after_date = decode_pdf_date(str(after.docinfo.CreationDate))
          assert before_date == after_date
  
          pdfa_info = file_claims_pdfa(outpdf)
          assert pdfa_info["output"] == output_type
  
imports: from __future__ import annotations
  import datetime
  import warnings
  from datetime import timezone
  from shutil import copyfile
  import pikepdf
  import pytest
  from packaging.version import Version
  from pikepdf.models.metadata import decode_pdf_date
  from ocrmypdf._exec import ghostscript
  from ocrmypdf._jobcontext import PdfContext
  from ocrmypdf._metadata import metadata_fixup
  from ocrmypdf._pipeline import convert_to_pdfa
  from ocrmypdf._plugin_manager import get_parser_options_plugins, get_plugin_manager
  from ocrmypdf.exceptions import ExitCode
  from ocrmypdf.pdfa import file_claims_pdfa, generate_pdfa_ps
  from ocrmypdf.pdfinfo import PdfInfo
  from .conftest import check_ocrmypdf, run_ocrmypdf, run_ocrmypdf_api
label_desc: Use image node_id 2 for calling a global function with example usage: test_override_metadata(output_type, resources, outpdf, caplog) without return types