code: def _update_resources(
      *,
      obj: Dictionary | Stream,
      font: Dictionary | None,
      font_key: Name | None,
  ):
      """Update this obj's fonts with a reference to the Glyphless font.
  
      obj can be a page or Form XObject.
      """
      resources = _ensure_dictionary(obj, Name.Resources)
      fonts = _ensure_dictionary(resources, Name.Font)
      if font_key is not None and font_key not in fonts:
          fonts[font_key] = font
  
file_path: OCRmyPDF/src/ocrmypdf/_graft.py
imports: from __future__ import annotations
  import logging
  from contextlib import suppress
  from enum import Enum
  from pathlib import Path
  from pikepdf import Dictionary, Matrix, Name, Operator, Page, Pdf, PdfError, Stream, parse_content_stream, unparse_content_stream
  from ocrmypdf._jobcontext import PdfContext
label_desc: Use image node_id 2 for calling a global function with example usage: _update_resources() without return types