docstr: find the connection file, and load the info if found.
  
  The current working directory and the current profile's security
  directory will be searched for the file if it is not given by
  absolute path.
  
  When attempting to connect to an existing kernel and the `--existing`
  argument does not match an existing file, it will be interpreted as a
  fileglob, and the matching file in the current profile's security dir
  with the latest access time will be used.
  
  After this method is called, self.connection_file contains the *full path*
  to the connection file, never just its name.
docstr_tok: ["find","the","connection","file",",","and","load","the","info","if","found",".","The","current","working","directory","and","the","current","profile","'s","security","directory","will","be","searched","for","the","file","if","it","is","not","given","by","absolute","path",".","When","attempting","to","connect","to","an","existing","kernel","and","the","`","--","existing","`","argument","does","not","match","an","existing","file",",","it","will","be","interpreted","as","a","fileglob",",","and","the","matching","file","in","the","current","profile","'s","security","dir","with","the","latest","access","time","will","be","used",".","After","this","method","is","called",",","self.connection_file","contains","the","*","full","path","*","to","the","connection","file",",","never","just","its","name","."]
code: def init_connection_file(self):
      """find the connection file, and load the info if found.
  
      The current working directory and the current profile's security
      directory will be searched for the file if it is not given by
      absolute path.
  
      When attempting to connect to an existing kernel and the `--existing`
      argument does not match an existing file, it will be interpreted as a
      fileglob, and the matching file in the current profile's security dir
      with the latest access time will be used.
  
      After this method is called, self.connection_file contains the *full path*
      to the connection file, never just its name.
      """
      if self.existing:
          try:
              cf = find_connection_file(
                  self.existing, [".", self.runtime_dir]
              )
          except Exception:
              self.log.critical(
                  "Could not find existing kernel connection file %s",
                  self.existing,
              )
              self.exit(1)
          self.log.debug("Connecting to existing kernel: %s" % cf)
          self.connection_file = cf
      else:
          # not existing, check if we are going to write the file
          # and ensure that self.connection_file is a full path, not just the shortname
          try:
              cf = find_connection_file(
                  self.connection_file, [self.runtime_dir]
              )
          except Exception:
              # file might not exist
              if self.connection_file == os.path.basename(
                  self.connection_file
              ):
                  # just shortname, put it in security dir
                  cf = os.path.join(
                      self.runtime_dir, self.connection_file
                  )
              else:
                  cf = self.connection_file
              self.connection_file = cf
      try:
          self.connection_file = filefind(
              self.connection_file, [".", self.runtime_dir]
          )
      except IOError:
          self.log.debug(
              "Connection File not found: %s", self.connection_file
          )
          return
  
      # should load_connection_file only be used for existing?
      # as it is now, this allows reusing ports if an existing
      # file is requested
      try:
          self.load_connection_file()
      except Exception:
          self.log.error(
              "Failed to load connection file: %r",
              self.connection_file,
              exc_info=True,
          )
          self.exit(1)
  
imports: import atexit
  import os
  import signal
  import sys
  import uuid
  import warnings
  from traitlets.config.application import boolean_flag
  from ipython_genutils.path import filefind
  from traitlets import Dict, List, Unicode, CUnicode, CBool, Any
  from jupyter_core.application import base_flags, base_aliases
  from .blocking import BlockingKernelClient
  from .restarter import KernelRestarter
  from .None import KernelManager, tunnel_to_kernel, find_connection_file, connect
  from .kernelspec import NoSuchKernel
  from .session import Session
  from .localinterfaces import localhost
label_desc: Use image node_id 3 for calling the JupyterConsoleApp obj's underlying member method code with example usage: obj.init_connection_file() without return types