code: def test_Print(capsys):
      r"""Make sure that `Print` `Op`\s are present in compiled graphs with constant folding."""
      x = as_tensor_variable(1.0) * as_tensor_variable(3.0)
      print_op = Print("hello")
      x_print = print_op(x)
  
      # Just to be more sure that we'll have constant folding...
      mode = get_mode("FAST_RUN").including("topo_constant_folding")
  
      fn = pytensor.function([], x_print, mode=mode)
  
      nodes = fn.maker.fgraph.toposort()
      assert len(nodes) == 2
      assert nodes[0].op == print_op
      assert nodes[1].op == deep_copy_op
  
      fn()
  
      stdout, stderr = capsys.readouterr()
      assert "hello" in stdout
  
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 12 for calling a global function with example usage: test_Print(capsys) without return types