class_docstr: Primary lexer for all IPython-like code.
  
  This is a simple helper lexer.  If the first line of the text begins with
  "In \[[0-9]+\]:", then the entire text is parsed with an IPython console
  lexer. If not, then the entire text is parsed with an IPython lexer.
  
  The goal is to reduce the number of lexers that are registered
  with Pygments.
docstr: Create a new IPyLexer instance which dispatch to either an
  IPythonCOnsoleLexer (if In prompts are present) or and IPythonLexer (if
  In prompts are not present).
docstr_tok: ["Create","a","new","IPyLexer","instance","which","dispatch","to","either","an","IPythonCOnsoleLexer","(","if","In","prompts","are","present",")","or","and","IPythonLexer","(","if","In","prompts","are","not","present",")","."]
code: def __init__(self, **options):
      """
      Create a new IPyLexer instance which dispatch to either an
      IPythonCOnsoleLexer (if In prompts are present) or and IPythonLexer (if
      In prompts are not present).
      """
      # init docstring is necessary for docs not to fail to build do to parent
      # docs referenceing a section in pygments docs.
      self.python3 = get_bool_opt(options, "python3", False)
      if self.python3:
          self.aliases = ["ipy3"]
      else:
          self.aliases = ["ipy2", "ipy"]
  
      Lexer.__init__(self, **options)
  
      self.IPythonLexer = IPythonLexer(**options)
      self.IPythonConsoleLexer = IPythonConsoleLexer(**options)
  
imports: import re
  from pygments.lexers import BashLexer, HtmlLexer, JavascriptLexer, RubyLexer, PerlLexer, PythonLexer, Python3Lexer, TexLexer
  from pygments.lexer import Lexer, DelegatingLexer, RegexLexer, do_insertions, bygroups, using
  from pygments.token import Generic, Keyword, Literal, Name, Operator, Other, Text, Error
  from pygments.util import get_bool_opt
label_desc: Use image node_id 1 to create a new IPyLexer object from inherited base classes: Lexer with example: obj = IPyLexer()