code: def _is_console(f: t.TextIO) -> bool:
      if not hasattr(f, "fileno"):
          return False
  
      try:
          fileno = f.fileno()
      except (OSError, io.UnsupportedOperation):
          return False
  
      handle = msvcrt.get_osfhandle(fileno)
      return bool(GetConsoleMode(handle, byref(DWORD())))
  
imports: import io
  import sys
  import time
  import typing
  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 Structure
  from ctypes.wintypes import DWORD
  from ctypes.wintypes import HANDLE
  from ctypes.wintypes import LPCWSTR
  from ctypes.wintypes import LPWSTR
  from ._compat import _NonClosingTextIOWrapper
  import msvcrt
  from ctypes import windll
  from ctypes import WINFUNCTYPE
label_desc: Use image node_id 4 for calling a global function with example usage: _is_console(f) and returns: bool, False, False