code: def test_unset_metadata(
      output_type, field, resources, outpdf, caplog
  ):
      input_file = resources / "meta.pdf"
  
      # magic strings contained in the input pdf metadata
      meta = {
          "title": b"NFY5f7Ft2DWMkxLhXwxvFf7eWR2KeK3vEDcd",
          "author": b"yXaryipxyRk9dVjWjSSaVaNCKeLRgEVzPRMp",
          "subject": b"t49vimctvnuH7ZeAjAkv52ACvWFjcnm5MPJr",
          "keywords": b"s9EeALwUg7urA7fnnhm5EtUyC54sW2WPUzqh",
      }
  
      exitcode = run_ocrmypdf_api(
          input_file,
          outpdf,
          f"--{field}",
          "",
          "--output-type",
          output_type,
          "--plugin",
          "tests/plugins/tesseract_noop.py",
      )
  
      assert exitcode == ExitCode.ok, caplog.text
  
      # We mainly want to ensure that when '' is passed, the corresponding
      # metadata is unset in the output pdf. Since metedata is not compressed,
      # the best way to gaurentee the metadata of interest didn't carry
      # forward is to just check to ensure the corresponding magic string
      # isn't contained anywhere in the output pdf. We'll also check to ensure
      # it's in the input pdf and that any values not unset are still in the
      # output pdf.
      with open(input_file, "rb") as before, open(
          outpdf, "rb"
      ) as after:
          before_data = before.read()
          after_data = after.read()
  
      for k, v in meta.items():
          assert v in before_data
          if k == field:
              assert v not in after_data
          else:
              assert v in after_data
  
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 3 for calling a global function with example usage: test_unset_metadata(output_type, field, resources, outpdf, caplog) without return types