class_docstr: A Mixin for applications that start InteractiveShell instances.
  
  Provides configurables for loading extensions and executing files
  as part of configuring a Shell environment.
  
  The following methods should be called by the :meth:`initialize` method
  of the subclass:
  
    - :meth:`init_path`
    - :meth:`init_shell` (to be implemented by the subclass)
    - :meth:`init_gui_pylab`
    - :meth:`init_extensions`
    - :meth:`init_code`
class_docstr_tok: ["A","Mixin","for","applications","that","start","InteractiveShell","instances",".","Provides","configurables","for","loading","extensions","and","executing","files","as","part","of","configuring","a","Shell","environment",".","The","following","methods","should","be","called","by","the",":","meth",":","`","initialize","`","method","of","the","subclass",":","-",":","meth",":","`","init_path","`","-",":","meth",":","`","init_shell","`","(","to","be","implemented","by","the","subclass",")","-",":","meth",":","`","init_gui_pylab","`","-",":","meth",":","`","init_extensions","`","-",":","meth",":","`","init_code","`"]
docstr: Add current working directory, '', to sys.path
  
  Unlike Python's default, we insert before the first `site-packages`
  or `dist-packages` directory,
  so that it is after the standard library.
  
  .. versionchanged:: 7.2
      Try to insert after the standard library, instead of first.
  .. versionchanged:: 8.0
      Allow optionally not including the current directory in sys.path
docstr_tok: ["Add","current","working","directory",",","``",",","to","sys.path","Unlike","Python","'s","default",",","we","insert","before","the","first","`","site-packages","`","or","`","dist-packages","`","directory",",","so","that","it","is","after","the","standard","library",".","..","versionchanged",":",":","7.2","Try","to","insert","after","the","standard","library",",","instead","of","first",".","..","versionchanged",":",":","8.0","Allow","optionally","not","including","the","current","directory","in","sys.path"]
code: def init_path(self):
      """Add current working directory, '', to sys.path
  
      Unlike Python's default, we insert before the first `site-packages`
      or `dist-packages` directory,
      so that it is after the standard library.
  
      .. versionchanged:: 7.2
          Try to insert after the standard library, instead of first.
      .. versionchanged:: 8.0
          Allow optionally not including the current directory in sys.path
      """
      if "" in sys.path or self.ignore_cwd:
          return
      for idx, path in enumerate(sys.path):
          parent, last_part = os.path.split(path)
          if last_part in {"site-packages", "dist-packages"}:
              break
      else:
          # no site-packages or dist-packages found (?!)
          # back to original behavior of inserting at the front
          idx = 0
      sys.path.insert(idx, "")
  
imports: import glob
  from itertools import chain
  import os
  import sys
  from traitlets.config.application import boolean_flag
  from traitlets.config.configurable import Configurable
  from traitlets.config.loader import Config
  from IPython.core.application import SYSTEM_CONFIG_DIRS, ENV_CONFIG_DIRS
  from IPython.core import pylabtools
  from IPython.utils.contexts import preserve_keys
  from IPython.utils.path import filefind
  from traitlets import Unicode, Instance, List, Bool, CaselessStrEnum, observe, DottedObjectName
  from IPython.terminal import pt_inputhooks
label_desc: Use image node_id 2 for calling the InteractiveShellApp obj's underlying member method code with example usage: obj.init_path() without return types