code: def test_optional_program_recommended(caplog):
      caplog.clear()
  
      def raiser():
          raise FileNotFoundError("jbig2")
  
      with caplog.at_level(logging.WARNING):
          vd.check_external_program(
              program="jbig2",
              package="jbig2enc",
              version_checker=raiser,
              need_version="42",
              required_for="this test case",
              recommended=True,
          )
          assert any(
              (loglevel == logging.WARNING and "recommended" in msg)
              for _logger_name, loglevel, msg in caplog.record_tuples
          )
  
imports: from __future__ import annotations
  import logging
  import os
  from unittest.mock import patch
  import pikepdf
  import pytest
  from ocrmypdf import _validation
  from ocrmypdf._concurrent import NullProgressBar, SerialExecutor
  from ocrmypdf._exec.tesseract import TesseractVersion
  from ocrmypdf._plugin_manager import get_plugin_manager
  from ocrmypdf.api import create_options
  from ocrmypdf.cli import get_parser
  from ocrmypdf.exceptions import BadArgsError, MissingDependencyError
  from ocrmypdf.pdfinfo import PdfInfo
  from .conftest import run_ocrmypdf_api
label_desc: Use image node_id 16 for calling a global function with example usage: test_optional_program_recommended(caplog) without return types