code: def main():
      
      save_settings = None
      stdin_fd = -1
      try:
          import termios
          stdin_fd = sys.stdin.fileno()
          save_settings = termios.tcgetattr(stdin_fd)
      except:
          pass
      try:
          real_main()
      finally:
          if save_settings:
              termios.tcsetattr(stdin_fd, termios.TCSANOW, save_settings)
docs: This main function saves the stdin termios settings, calls real_main,
         and restores stdin termios settings when it returns.