code: def _is_interactive():
      if os.environ.get("PARLAI_FORCE_COLOR"):
          return True
      try:
          __IPYTHON__
          return True
      except NameError:
          return sys.stdout.isatty()
  
imports: import os
  import sys
  import logging
  from logging import getLogger
label_desc: Use image node_id 1 for calling a global function with example usage: _is_interactive() and returns: True, True, sys