code: def get_stream_handle(stream=sys.stdout):
      
      handle = stream
      if os.name == "nt":
          from ._winconsole import get_stream_handle as get_win_stream_handle
  
          return get_win_stream_handle(stream)
      return handle
docs: Get the OS appropriate handle for the corresponding output stream.
  
      :param str stream: The the stream to get the handle for
      :return: A handle to the appropriate stream, either a ctypes buffer
               or **sys.stdout** or **sys.stderr**.