code: def unwrap_stream(stream_name):
      
      wrapped_stream = None
      try:
          wrapped_stream = getattr(sys, stream_name)
          if hasattr(wrapped_stream, '_original_stream'):
              setattr(sys, stream_name, wrapped_stream._original_stream)
          yield
      finally:
          if wrapped_stream:
              setattr(sys, stream_name, wrapped_stream)
docs: Temporarily unwraps a given stream (stdin, stdout, or stderr) to undo the effects of wrap_stdio_in_codecs().