code: def test_PatternPrinter():
      r1, r2 = MyVariable("1"), MyVariable("2")
      op1 = MyOp("op1")
      o1 = op1(r1, r2)
      o1.name = "o1"
  
      pprint = PPrinter()
      pprint.assign(op1, PatternPrinter(("|%(0)s - %(1)s|", -1000)))
      pprint.assign(lambda pstate, r: True, default_printer)
  
      res = pprint(o1)
  
      assert res == "|1 - 2|"
  
imports: import logging
  from io import StringIO
  from textwrap import dedent
  import numpy
  import pytest
  import pytensor
  from pytensor.compile.mode import get_mode
  from pytensor.compile.ops import deep_copy_op
  from pytensor.printing import PatternPrinter, PPrinter, Print, debugprint, default_printer, get_node_by_id, min_informative_str, pp, pydot_imported, pydotprint
  from pytensor.tensor import as_tensor_variable
  from pytensor.tensor.type import dmatrix, dvector, matrix
  from tests.graph.utils import MyInnerGraphOp, MyOp, MyVariable
label_desc: Use image node_id 11 for calling a global function with example usage: test_PatternPrinter() without return types