code: def rasterize_pdf_page(
      input_file,
      output_file,
      raster_device,
      raster_dpi,
      pageno,
      page_dpi,
      rotation,
      filter_vector,
      stop_on_soft_error,
  ) -> Path:
      with patch("ocrmypdf._exec.ghostscript.run") as mock:
          mock.side_effect = fail_if_stoponerror
          ghostscript.rasterize_pdf_page(
              input_file=input_file,
              output_file=output_file,
              raster_device=raster_device,
              raster_dpi=raster_dpi,
              pageno=pageno,
              page_dpi=page_dpi,
              rotation=rotation,
              filter_vector=filter_vector,
              stop_on_soft_error=stop_on_soft_error,
          )
          mock.assert_called()
          return output_file
  
file_path: OCRmyPDF/tests/plugins/gs_raster_soft_error.py
imports: from __future__ import annotations
  from pathlib import Path
  from subprocess import CalledProcessError
  from unittest.mock import patch
  from ocrmypdf import hookimpl
  from ocrmypdf.builtin_plugins import ghostscript
  from ocrmypdf.subprocess import run
label_desc: Use image node_id 2 for calling a global function with example usage: rasterize_pdf_page(input_file, output_file, raster_device, raster_dpi, pageno, page_dpi, rotation, filter_vector, stop_on_soft_error) and returns: output_file