class_docstr: Base class for the reference tests.
class_docstr_tok: ["Base","class","for","the","reference","tests","."]
docstr: Executes `func`, capturing stdout.
docstr_tok: ["Executes","`","func","`",",","capturing","stdout","."]
code: def _run_with_output_capture(self, func):
      """Executes `func`, capturing stdout."""
      out_capturer = io.StringIO()
      results = None
      captured_out = None
      captured_err = None
      try:
          sys.stdout = out_capturer
          results = func()
          captured_out = out_capturer.getvalue()
      except Exception as e:  # pylint:disable=broad-except
          sys.stdout = sys.__stdout__
          captured_err = e
          print(
              "*** Capturing exception:\n{}\n".format(
                  traceback.format_exc()
              )
          )
      finally:
          sys.stdout = sys.__stdout__
          out_capturer.close()
      return results, captured_out, captured_err
  
imports: import io
  import numbers
  import os
  import sys
  import traceback
  import numpy
  import tensorflow
label_desc: Use image node_id 2 for calling the TestCase obj's underlying member method code with example usage: obj._run_with_output_capture(func) and returns: results,  captured_out,  captured_err