code: def test_basic(multipage, palette, pdf, outpdf):
      infile = multipage if pdf == "multipage" else palette
      opt.main(infile, outpdf, level=3)
  
      assert (
          0.98 * Path(outpdf).stat().st_size
          <= Path(infile).stat().st_size
      )
  
imports: from __future__ import annotations
  from io import BytesIO
  from os import fspath
  from pathlib import Path
  from unittest.mock import MagicMock, patch
  import img2pdf
  import pikepdf
  import pytest
  from pikepdf import Array, Dictionary, Name
  from PIL import Image, ImageDraw
  from ocrmypdf import optimize
  from ocrmypdf._exec import jbig2enc, pngquant
  from ocrmypdf._exec.ghostscript import rasterize_pdf
  from ocrmypdf.helpers import IMG2PDF_KWARGS, Resolution
  from ocrmypdf.optimize import PdfImage, extract_image_filter
  from tests.conftest import check_ocrmypdf
label_desc: Use image node_id 2 for calling a global function with example usage: test_basic(multipage, palette, pdf, outpdf) without return types