code: def expectedFailureIfStdinIsTTY(fun):
      # avoid isatty()
      try:
          tty.tcgetattr(pty.STDIN_FILENO)
          return unittest.expectedFailure(fun)
      except tty.error:
          pass
      return fun
  
imports: from test.support import verbose, reap_children
  from test.support.import_helper import import_module
  import errno
  import os
  import pty
  import tty
  import sys
  import select
  import signal
  import socket
  import io
  import unittest
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: expectedFailureIfStdinIsTTY(fun) and returns: fun, unittest