docstr: Patch important libraries that can't handle sys.stdout forwarding
code: def patch_io(self):
      """Patch important libraries that can't handle sys.stdout forwarding"""
      try:
          import faulthandler
      except ImportError:
          pass
      else:
          # Warning: this is a monkeypatch of `faulthandler.enable`, watch for possible
          # updates to the upstream API and update accordingly (up-to-date as of Python 3.5):
          # https://docs.python.org/3/library/faulthandler.html#faulthandler.enable
  
          # change default file to __stderr__ from forwarded stderr
          faulthandler_enable = faulthandler.enable
  
          def enable(file=sys.__stderr__, all_threads=True, **kwargs):
              return faulthandler_enable(
                  file=file, all_threads=all_threads, **kwargs
              )
  
          faulthandler.enable = enable
  
          if hasattr(faulthandler, "register"):
              faulthandler_register = faulthandler.register
  
              def register(
                  signum,
                  file=sys.__stderr__,
                  all_threads=True,
                  chain=False,
                  **kwargs,
              ):
                  return faulthandler_register(
                      signum,
                      file=file,
                      all_threads=all_threads,
                      chain=chain,
                      **kwargs,
                  )
  
              faulthandler.register = register
  
imports: from __future__ import print_function
  import atexit
  import os
  import sys
  import signal
  import traceback
  import logging
  from tornado import ioloop
  import zmq
  from zmq.eventloop import ioloop
  from zmq.eventloop.zmqstream import ZMQStream
  from IPython.core.application import BaseIPythonApplication, base_flags, base_aliases, catch_config_error
  from IPython.core.profiledir import ProfileDir
  from IPython.core.shellapp import InteractiveShellApp, shell_flags, shell_aliases
  from IPython.utils import io
  from ipython_genutils.path import filefind, ensure_dir_exists
  from traitlets import Any, Instance, Dict, Unicode, Integer, Bool, DottedObjectName, Type, default
  from ipython_genutils.importstring import import_item
  from jupyter_core.paths import jupyter_runtime_dir
  from jupyter_client import write_connection_file
  from jupyter_client.connect import ConnectionFileMixin
  from .iostream import IOPubThread
  from .heartbeat import Heartbeat
  from .ipkernel import IPythonKernel
  from .parentpoller import ParentPollerUnix, ParentPollerWindows
  from jupyter_client.session import Session, session_flags, session_aliases
  from .zmqshell import ZMQInteractiveShell
label_desc: Use image node_id 16 for calling the IPKernelApp obj's underlying member method code with example usage: obj.patch_io() and returns: faulthandler_enable, faulthandler_register