code: def _postscript_objdef(
      alias: str,
      dictionary: dict[str, str],
      *,
      stream_name: str | None = None,
      stream_data: bytes | None = None,
  ) -> Iterator[str]:
      assert (stream_name is None) == (stream_data is None)
  
      objtype = "/stream" if stream_name else "/dict"
  
      if stream_name:
          assert stream_data is not None
          a85_data = base64.a85encode(stream_data, adobe=True).decode(
              "ascii"
          )
          yield f"{stream_name} " + a85_data
          yield "def"
  
      if alias != "{Catalog}":  # Catalog needs no definition
          yield f"[/_objdef {alias} /type {objtype} /OBJ pdfmark"
  
      yield f"[{alias} <<"
      for key, val in dictionary.items():
          yield f"  {key} {val}"
      yield ">> /PUT pdfmark"
  
      if stream_name:
          yield f"[{alias} {stream_name[1:]} /PUT pdfmark"
  
file_path: OCRmyPDF/src/ocrmypdf/pdfa.py
imports: from __future__ import annotations
  import base64
  from collections.abc import Iterator
  from importlib.resources import files
  from pathlib import Path
  import pikepdf
label_desc: Use image node_id 1 for calling a global function with example usage: _postscript_objdef(alias, dictionary) without return types