class_docstr: A class to embed a kernel into the GTK main event loop.
docstr: Hijack a few key functions in GTK for IPython integration.
  
  Modifies pyGTK's main and main_quit with a dummy so user code does not
  block IPython.  This allows us to use %run to run arbitrary pygtk
  scripts from a long-lived IPython session, and when they attempt to
  start or stop
  
  Returns
  -------
  The original functions that have been hijacked:
  - Gtk.main
  - Gtk.main_quit
docstr_tok: ["Hijack","a","few","key","functions","in","GTK","for","IPython","integration",".","Modifies","pyGTK","'s","main","and","main_quit","with","a","dummy","so","user","code","does","not","block","IPython",".","This","allows","us","to","use","%","run","to","run","arbitrary","pygtk","scripts","from","a","long-lived","IPython","session",",","and","when","they","attempt","to","start","or","stop","Returns","--","--","--","-","The","original","functions","that","have","been","hijacked",":","-","Gtk.main","-","Gtk.main_quit"]
code: def _hijack_gtk(self):
      """Hijack a few key functions in GTK for IPython integration.
  
      Modifies pyGTK's main and main_quit with a dummy so user code does not
      block IPython.  This allows us to use %run to run arbitrary pygtk
      scripts from a long-lived IPython session, and when they attempt to
      start or stop
  
      Returns
      -------
      The original functions that have been hijacked:
      - Gtk.main
      - Gtk.main_quit
      """
  
      def dummy(*args, **kw):
          """No-op."""
  
      # save and trap main and main_quit from gtk
      orig_main, Gtk.main = Gtk.main, dummy
      orig_main_quit, Gtk.main_quit = Gtk.main_quit, dummy
      return orig_main, orig_main_quit
  
file_path: catboost/contrib/python/ipykernel/py3/ipykernel/gui/gtk3embed.py
imports: import sys
  import warnings
  import gi
  from gi.repository import GObject, Gtk
label_desc: Use image node_id 6 for calling the GTKEmbed obj's underlying member method code with example usage: obj._hijack_gtk() and returns: orig_main,  orig_main_quit