def get_connection_file(app=None):
if app is None:<EOL><INDENT>from IPython.zmq.ipkernel import IPKernelApp<EOL>if not IPKernelApp.initialized():<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>app = IPKernelApp.instance()<EOL><DEDENT>return filefind(app.connection_file, ['<STR_LIT:.>', app.profile_dir.security_dir])<EOL>
Return the path to the connection file of an app

    Parameters
    ----------
    app : KernelApp instance [optional]
        If unspecified, the currently running app will be used