class_docstr: Extension of the completer class with IPython-specific features
class_docstr_tok: ["Extension","of","the","completer","class","with","IPython-specific","features"]
docstr: IPCompleter() -> completer
  
  Return a completer object suitable for use by the readline library
  via readline.set_completer().
  
  Inputs:
  
  - shell: a pointer to the ipython shell itself.  This is needed
    because this completer knows about magic functions, and those can
    only be accessed via the ipython instance.
  
  - namespace: an optional dict where completions are performed.
  
  - global_namespace: secondary optional dict for completions, to
    handle cases (such as IPython embedded inside functions) where
    both Python scopes are visible.
  
  use_readline : bool, optional
    If true, use the readline library.  This completer can still function
    without readline, though in that case callers must provide some extra
    information on each call about the current line.
docstr_tok: ["IPCompleter","(",")","-",">","completer","Return","a","completer","object","suitable","for","use","by","the","readline","library","via","readline.set_completer","(",")",".","Inputs",":","-","shell",":","a","pointer","to","the","ipython","shell","itself",".","This","is","needed","because","this","completer","knows","about","magic","functions",",","and","those","can","only","be","accessed","via","the","ipython","instance",".","-","namespace",":","an","optional","dict","where","completions","are","performed",".","-","global_namespace",":","secondary","optional","dict","for","completions",",","to","handle","cases","(","such","as","IPython","embedded","inside","functions",")","where","both","Python","scopes","are","visible",".","use_readline",":","bool",",","optional","If","true",",","use","the","readline","library",".","This","completer","can","still","function","without","readline",",","though","in","that","case","callers","must","provide","some","extra","information","on","each","call","about","the","current","line","."]
code: def __init__(
      self,
      shell=None,
      namespace=None,
      global_namespace=None,
      use_readline=True,
      config=None,
      **kwargs,
  ):
      """IPCompleter() -> completer
  
      Return a completer object suitable for use by the readline library
      via readline.set_completer().
  
      Inputs:
  
      - shell: a pointer to the ipython shell itself.  This is needed
        because this completer knows about magic functions, and those can
        only be accessed via the ipython instance.
  
      - namespace: an optional dict where completions are performed.
  
      - global_namespace: secondary optional dict for completions, to
        handle cases (such as IPython embedded inside functions) where
        both Python scopes are visible.
  
      use_readline : bool, optional
        If true, use the readline library.  This completer can still function
        without readline, though in that case callers must provide some extra
        information on each call about the current line."""
  
      self.magic_escape = ESC_MAGIC
      self.splitter = CompletionSplitter()
  
      # Readline configuration, only used by the rlcompleter method.
      if use_readline:
          # We store the right version of readline so that later code
          import IPython.utils.rlineimpl as readline
  
          self.readline = readline
      else:
          self.readline = None
  
      # _greedy_changed() depends on splitter and readline being defined:
      Completer.__init__(
          self,
          namespace=namespace,
          global_namespace=global_namespace,
          config=config,
          **kwargs,
      )
  
      # List where completion matches will be stored
      self.matches = []
      self.shell = shell
      # Regexp to split filenames with spaces in them
      self.space_name_re = re.compile(r"([^\\] )")
      # Hold a local ref. to glob.glob for speed
      self.glob = glob.glob
  
      # Determine if we are running on 'dumb' terminals, like (X)Emacs
      # buffers, to avoid completion problems.
      term = os.environ.get("TERM", "xterm")
      self.dumb_terminal = term in ["dumb", "emacs"]
  
      # Special handling of backslashes needed in win32 platforms
      if sys.platform == "win32":
          self.clean_glob = self._clean_glob_win32
      else:
          self.clean_glob = self._clean_glob
  
      # regexp to parse docstring for function signature
      self.docstring_sig_re = re.compile(r"^[\w|\s.]+\(([^)]*)\).*")
      self.docstring_kwd_re = re.compile(r"[\s|\[]*(\w+)(?:\s*=\s*.*)")
      # use this if positional argument name is also needed
      # = re.compile(r'[\s|\[]*(\w+)(?:\s*=?\s*.*)')
  
      # All active matcher routines for completion
      self.matchers = [
          self.python_matches,
          self.file_matches,
          self.magic_matches,
          self.python_func_kw_matches,
          self.dict_key_matches,
      ]
  
      # This is set externally by InteractiveShell
      self.custom_completers = None
  
imports: from __future__ import print_function
  import __main__
  import glob
  import inspect
  import itertools
  import keyword
  import os
  import re
  import sys
  import unicodedata
  import string
  import warnings
  from traitlets.config.configurable import Configurable
  from IPython.core.error import TryNext
  from IPython.core.inputsplitter import ESC_MAGIC
  from IPython.core.latex_symbols import latex_symbols, reverse_latex_symbol
  from IPython.utils import generics
  from IPython.utils.decorators import undoc
  from IPython.utils.dir2 import dir2, get_real_method
  from IPython.utils.process import arg_split
  from IPython.utils.py3compat import builtin_mod, string_types, PY3, cast_unicode_py2
  from traitlets import Bool, Enum, observe
label_desc: Use image node_id 3 to create a new IPCompleter object from inherited base classes: Completer with example: obj = IPCompleter(shell, namespace, global_namespace, use_readline, config)