class_docstr: Context manager to redirect stdout for exec_command test.
class_docstr_tok: ["Context","manager","to","redirect","stdout","for","exec_command","test","."]
code: def __enter__(self):
      self.old_stdout = sys.stdout
      sys.stdout = self._stdout
  
imports: import os
  import pytest
  import sys
  from tempfile import TemporaryFile
  from numpy.distutils import exec_command
  from numpy.distutils.exec_command import get_pythonexe
  from numpy.testing import tempdir, assert_, assert_warns, IS_WASM
  from io import StringIO
label_desc: Use image node_id 2 for calling the redirect_stdout obj's underlying member method code with example usage: obj.__enter__() without return types