code: def convert_single(cwd, infile, outfile, threshold):
      args = ["jbig2", "--pdf", "-t", str(threshold), infile]
      with open(outfile, "wb") as fstdout:
          proc = run(args, cwd=cwd, stdout=fstdout, stderr=PIPE)
      proc.check_returncode()
      return proc
  
file_path: OCRmyPDF/src/ocrmypdf/_exec/jbig2enc.py
imports: from __future__ import annotations
  from subprocess import PIPE
  from packaging.version import Version
  from ocrmypdf.exceptions import MissingDependencyError
  from ocrmypdf.subprocess import get_version, run
label_desc: Use image node_id 4 for calling a global function with example usage: convert_single(cwd, infile, outfile, threshold) and returns: proc