code: def _get_windows_console_stream(f, encoding, errors):
      if (
          get_buffer is not None
          and encoding in ("utf-16-le", None)
          and errors in ("strict", None)
          and _is_console(f)
      ):
          func = _stream_factories.get(f.fileno())
          if func is not None:
              if not PY2:
                  f = getattr(f, "buffer", None)
                  if f is None:
                      return None
              else:
                  # If we are on Python 2 we need to set the stream that we
                  # deal with to binary mode as otherwise the exercise if a
                  # bit moot.  The same problems apply as for
                  # get_binary_stdin and friends from _compat.
                  msvcrt.setmode(f.fileno(), os.O_BINARY)
              return func(f)
  
imports: import ctypes
  import io
  import os
  import sys
  import time
  import zlib
  from ctypes import byref
  from ctypes import c_char
  from ctypes import c_char_p
  from ctypes import c_int
  from ctypes import c_ssize_t
  from ctypes import c_ulong
  from ctypes import c_void_p
  from ctypes import POINTER
  from ctypes import py_object
  from ctypes import windll
  from ctypes import WinError
  from ctypes import WINFUNCTYPE
  from ctypes.wintypes import DWORD
  from ctypes.wintypes import HANDLE
  from ctypes.wintypes import LPCWSTR
  from ctypes.wintypes import LPWSTR
  import msvcrt
  from ._compat import _NonClosingTextIOWrapper
  from ._compat import PY2
  from ._compat import text_type
label_desc: Use image node_id 6 for calling a global function with example usage: _get_windows_console_stream(f, encoding, errors) and returns: func, None