class_docstr: An object that can accumulate lines of Python source before execution.
  
  This object is designed to be fed python source line-by-line, using
  :meth:`push`. It will return on each push whether the currently pushed
  code could be executed already. In addition, it provides a method called
  :meth:`push_accepts_more` that can be used to query whether more input
  can be pushed into a single interactive block.
  
  This is a simple example of how an interactive terminal-based client can use
  this tool::
  
      isp = InputSplitter()
      while isp.push_accepts_more():
          indent = ' '*isp.indent_spaces
          prompt = '>>> ' + indent
          line = indent + raw_input(prompt)
          isp.push(line)
      print 'Input source was:\n', isp.source_reset(),
class_docstr_tok: ["An","object","that","can","accumulate","lines","of","Python","source","before","execution",".","This","object","is","designed","to","be","fed","python","source","line-by-line",",","using",":","meth",":","`","push","`",".","It","will","return","on","each","push","whether","the","currently","pushed","code","could","be","executed","already",".","In","addition",",","it","provides","a","method","called",":","meth",":","`","push_accepts_more","`","that","can","be","used","to","query","whether","more","input","can","be","pushed","into","a","single","interactive","block",".","This","is","a","simple","example","of","how","an","interactive","terminal-based","client","can","use","this","tool",":",":","isp","=","InputSplitter","(",")","while","isp.push_accepts_more","(",")",":","indent","=","'","'","*","isp.indent_spaces","prompt","=","'",">",">",">","'","+","indent","line","=","indent","+","raw_input","(","prompt",")","isp.push","(","line",")","print","'Input","source","was",":","\\n","'",",","isp.source_reset","(",")",","]
docstr: Push one or more lines of input.
  
  This stores the given lines and returns a status code indicating
  whether the code forms a complete Python block or not.
  
  Any exceptions generated in compilation are swallowed, but if an
  exception was produced, the method returns True.
  
  Parameters
  ----------
  lines : string
      One or more lines of Python input.
  
  Returns
  -------
  is_complete : boolean
      True if the current input source (the result of the current input
      plus prior inputs) forms a complete Python execution block.  Note that
      this value is also stored as a private attribute (``_is_complete``), so it
      can be queried at any time.
docstr_tok: ["Push","one","or","more","lines","of","input",".","This","stores","the","given","lines","and","returns","a","status","code","indicating","whether","the","code","forms","a","complete","Python","block","or","not",".","Any","exceptions","generated","in","compilation","are","swallowed",",","but","if","an","exception","was","produced",",","the","method","returns","True",".","Parameters","--","--","--","--","--","lines",":","string","One","or","more","lines","of","Python","input",".","Returns","--","--","--","-","is_complete",":","boolean","True","if","the","current","input","source","(","the","result","of","the","current","input","plus","prior","inputs",")","forms","a","complete","Python","execution","block",".","Note","that","this","value","is","also","stored","as","a","private","attribute","(","``","_is_complete","``",")",",","so","it","can","be","queried","at","any","time","."]
code: def push(self, lines: str) -> bool:
      """Push one or more lines of input.
  
      This stores the given lines and returns a status code indicating
      whether the code forms a complete Python block or not.
  
      Any exceptions generated in compilation are swallowed, but if an
      exception was produced, the method returns True.
  
      Parameters
      ----------
      lines : string
          One or more lines of Python input.
  
      Returns
      -------
      is_complete : boolean
          True if the current input source (the result of the current input
          plus prior inputs) forms a complete Python execution block.  Note that
          this value is also stored as a private attribute (``_is_complete``), so it
          can be queried at any time.
      """
      assert isinstance(lines, str)
      self._store(lines)
      source = self.source
  
      # Before calling _compile(), reset the code object to None so that if an
      # exception is raised in compilation, we don't mislead by having
      # inconsistent code/source attributes.
      self.code, self._is_complete = None, None
      self._is_invalid = False
  
      # Honor termination lines properly
      if source.endswith("\\\n"):
          return False
  
      try:
          with warnings.catch_warnings():
              warnings.simplefilter("error", SyntaxWarning)
              self.code = self._compile(source, symbol="exec")
      # Invalid syntax can produce any of a number of different errors from
      # inside the compiler, so we have to catch them all.  Syntax errors
      # immediately produce a 'ready' block, so the invalid Python can be
      # sent to the kernel for evaluation with possible ipython
      # special-syntax conversion.
      except (
          SyntaxError,
          OverflowError,
          ValueError,
          TypeError,
          MemoryError,
          SyntaxWarning,
      ):
          self._is_complete = True
          self._is_invalid = True
      else:
          # Compilation didn't produce any exceptions (though it may not have
          # given a complete code object)
          self._is_complete = self.code is not None
  
      return self._is_complete
  
imports: from warnings import warn
  import ast
  import codeop
  import io
  import re
  import sys
  import tokenize
  import warnings
  from typing import List, Tuple, Union, Optional
  from types import CodeType
  from IPython.core.inputtransformer import leading_indent, classic_prompt, ipy_prompt, cellmagic, assemble_logical_lines, help_end, escaped_commands, assign_from_magic, assign_from_system, assemble_python_lines
  from IPython.utils import tokenutil
  from IPython.core.inputtransformer import ESC_SHELL, ESC_SH_CAP, ESC_HELP, ESC_HELP2, ESC_MAGIC, ESC_MAGIC2, ESC_QUOTE, ESC_QUOTE2, ESC_PAREN, ESC_SEQUENCES
label_desc: Use image node_id 5 for calling the InputSplitter obj's underlying member method code with example usage: obj.push(lines) and returns: self, False