class_docstr: ::
  
      with raw_mode(stdin):
          ''' the pseudo-terminal stdin is now used in raw mode '''
  
  We ignore errors when executing `tcgetattr` fails.
code: def __enter__(self) -> None:
      # NOTE: On os X systems, using pty.setraw() fails. Therefor we are using this:
      try:
          newattr = termios.tcgetattr(self.fileno)
      except termios.error:
          pass
      else:
          newattr[tty.LFLAG] = self._patch_lflag(newattr[tty.LFLAG])
          newattr[tty.IFLAG] = self._patch_iflag(newattr[tty.IFLAG])
  
          # VMIN defines the number of characters read at a time in
          # non-canonical mode. It seems to default to 1 on Linux, but on
          # Solaris and derived operating systems it defaults to 4. (This is
          # because the VMIN slot is the same as the VEOF slot, which
          # defaults to ASCII EOT = Ctrl-D = 4.)
          newattr[tty.CC][termios.VMIN] = 1
  
          termios.tcsetattr(self.fileno, termios.TCSANOW, newattr)
  
imports: from __future__ import annotations
  import sys
  import contextlib
  import io
  import termios
  import tty
  from asyncio import AbstractEventLoop, get_running_loop
  from typing import Callable, ContextManager, Generator, TextIO
  from ..key_binding import KeyPress
  from .base import Input
  from .posix_utils import PosixStdinReader
  from .vt100_parser import Vt100Parser
label_desc: Use image node_id 2 for calling the raw_mode obj's underlying member method code with example usage: obj.__enter__() without return types