parameters: (stream_name)
docstring: Return a context manager used by captured_stdout/stdin/stderr
      that temporarily replaces the sys stream *stream_name* with a StringIO.
  
      Taken from Lib/support/__init__.py in the CPython repo.
docstring_summary: Return a context manager used by captured_stdout/stdin/stderr
      that temporarily replaces the sys stream *stream_name* with a StringIO.
docstring_tokens: Return a context manager used by captured_stdout / stdin / stderr that temporarily replaces the sys stream * stream_name * with a StringIO .
function: def captured_output(stream_name):
      """Return a context manager used by captured_stdout/stdin/stderr
      that temporarily replaces the sys stream *stream_name* with a StringIO.
  
      Taken from Lib/support/__init__.py in the CPython repo.
      """
      orig_stdout = getattr(sys, stream_name)
      setattr(sys, stream_name, StreamWrapper.from_stream(orig_stdout))
      try:
          yield getattr(sys, stream_name)
      finally:
          setattr(sys, stream_name, orig_stdout)
function_tokens: def captured_output ( stream_name ) : orig_stdout = getattr ( sys , stream_name ) setattr ( sys , stream_name , StreamWrapper . from_stream ( orig_stdout ) ) try : yield getattr ( sys , stream_name ) finally : setattr ( sys , stream_name , orig_stdout )