'DEPRECATED since IPython 5.0
Enable event loop integration with Tk.
Parameters
app : toplevel :class:`Tkinter.Tk` widget, optional.
Running toplevel widget to use.  If not given, we probe Tk for an
existing one, and create a new one if none is found.
Notes
If you have already created a :class:`Tkinter.Tk` object, the only
thing done by this method is to register with the
:class:`InputHookManager`, since creating that object automatically
sets ``PyOS_InputHook``.'

def enable(self, app=None):

    warn('This    function    is    deprecated    since    IPython    5.0    and    will    be    removed    in    future    versions.', DeprecationWarning, stacklevel=2)
    if (app is None):
        try:
            from tkinter import Tk
        except ImportError:
            from Tkinter import Tk
        app = Tk()
        app.withdraw()
        self.manager.apps[GUI_TK] = app
        return app
