code: def trap_stdout():  # XXX: better with contextmanager?
      "temporarily trap stdout; return original sys.stdout"
      orig, sys.stdout = sys.stdout, StringIO()
      return orig
  
imports: import sys
  from io import StringIO
  import unittest
  from math import *
  from mystic.math import almostEqual
label_desc: Use image node_id 1 for calling a global function with example usage: trap_stdout() and returns: orig