docstr: Enable GUI event loop integration, taking pylab into account.
code: def init_gui_pylab(self):
      """Enable GUI event loop integration, taking pylab into account."""
  
      # Register inline backend as default
      # this is higher priority than matplotlibrc,
      # but lower priority than anything else (mpl.use() for instance).
      # This only affects matplotlib >= 1.5
      if not os.environ.get("MPLBACKEND"):
          os.environ[
              "MPLBACKEND"
          ] = "module://ipykernel.pylab.backend_inline"
  
      # Provide a wrapper for :meth:`InteractiveShellApp.init_gui_pylab`
      # to ensure that any exception is printed straight to stderr.
      # Normally _showtraceback associates the reply with an execution,
      # which means frontends will never draw it, as this exception
      # is not associated with any execute request.
  
      shell = self.shell
      _showtraceback = shell._showtraceback
      try:
          # replace error-sending traceback with stderr
          def print_tb(etype, evalue, stb):
              print(
                  "GUI event loop or pylab initialization failed",
                  file=sys.stderr,
              )
              print(shell.InteractiveTB.stb2text(stb), file=sys.stderr)
  
          shell._showtraceback = print_tb
          InteractiveShellApp.init_gui_pylab(self)
      finally:
          shell._showtraceback = _showtraceback
  
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 19 for calling the IPKernelApp obj's underlying member method code with example usage: obj.init_gui_pylab() without return types