code: def _ensure_dictionary(obj: Dictionary | Stream, name: Name):
      if name not in obj:
          obj[name] = Dictionary({})
      return obj[name]
  
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 1 for calling a global function with example usage: _ensure_dictionary(obj, name) and returns: obj