code: def connect_qtconsole(connection_file=None, argv=None, profile=None):
      """Connect a qtconsole to the current kernel.
  
      This is useful for connecting a second qtconsole to a kernel, or to a
      local notebook.
  
      Parameters
      ----------
      connection_file : str [optional]
          The connection file to be used. Can be given by absolute path, or
          IPython will search in the security directory of a given profile.
          If run from IPython,
  
          If unspecified, the connection file for the currently running
          IPython Kernel will be used, which is only allowed from inside a kernel.
      argv : list [optional]
          Any extra args to be passed to the console.
      profile : DEPRECATED
  
      Returns
      -------
      :class:`subprocess.Popen` instance running the qtconsole frontend
      """
      argv = [] if argv is None else argv
  
      cf = _find_connection_file(connection_file, profile)
  
      cmd = ";".join(
          [
              "from IPython.qt.console import qtconsoleapp",
              "qtconsoleapp.main()",
          ]
      )
  
      kwargs = {}
      if PY3:
          # Launch the Qt console in a separate session & process group, so
          # interrupting the kernel doesn't kill it. This kwarg is not on Py2.
          kwargs["start_new_session"] = True
  
      return Popen(
          [sys.executable, "-c", cmd, "--existing", cf] + argv,
          stdout=PIPE,
          stderr=PIPE,
          close_fds=(sys.platform != "win32"),
          **kwargs,
      )
  
file_path: catboost/contrib/python/ipykernel/py2/ipykernel/connect.py
imports: from __future__ import absolute_import
  import json
  import sys
  from subprocess import Popen, PIPE
  import warnings
  from IPython.core.profiledir import ProfileDir
  from IPython.paths import get_ipython_dir
  from ipython_genutils.path import filefind
  from ipython_genutils.py3compat import str_to_bytes, PY3
  import jupyter_client
  from jupyter_client import write_connection_file
label_desc: Use image node_id 5 for calling a global function with example usage: connect_qtconsole(connection_file, argv, profile) and returns: Popen