          2 : down
          3 : left
          Should not be called in the same program as getch(). """
  
          if self.is_gui:
              return None
          if os.name == "nt":
              msvcrt.getch()  # skip 0xE0
              char = msvcrt.getch()
              vals = [72, 77, 80, 75]
 
</s> remove         if self.is_gui and os.name != "nt":
 </s> add         if self.is_gui and os.name != "nt" or not sys.stdout.isatty(): </s> remove         if os.name == "nt" or self.is_gui:
 </s> add         if os.name == "nt" or self.is_gui or not sys.stdout.isatty(): </s> remove         if self.is_gui and os.name != "nt":
 </s> add         if self.is_gui and os.name != "nt" or not sys.stdout.isatty(): </s> remove         if os.name == "nt" or self.is_gui:
 </s> add         if os.name == "nt" or self.is_gui or not sys.stdout.isatty(): </s> remove         if not self._args.redirect_gui and not self._args.colab:
 </s> add         if not self._args.redirect_gui and not self._args.colab and sys.stdout.isatty():
        if self.is_gui or not sys.stdout.isatty():
          2 : down
          3 : left
          Should not be called in the same program as getch(). """
  
        if self.is_gui or not sys.stdout.isatty():
              return None
          if os.name == "nt":
              msvcrt.getch()  # skip 0xE0
              char = msvcrt.getch()
              vals = [72, 77, 80, 75]
keep keep keep keep replace keep keep keep keep keep
 trainer: add support for non-interactive jobs (#1193)

Add support for training in non-interactive shell environment such
as Sun Grid Engine, Univa Grid Engine and others.

Tested on Univa Grid Engine.

Reference: https://stackoverflow.com/questions/967369/python-find-out-if-running-in-shell-or-not-e-g-sun-grid-engine-queue. 
lib/keypress.py