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: Return whether a block of interactive input can accept more input.
  
  This method is meant to be used by line-oriented frontends, who need to
  guess whether a block is complete or not based solely on prior and
  current input lines.  The InputSplitter considers it has a complete
  interactive block and will not accept more input when either:
  
  * A SyntaxError is raised
  
  * The code is complete and consists of a single line or a single
    non-compound statement
  
  * The code is complete and has a blank line at the end
  
  If the current input produces a syntax error, this method immediately
  returns False but does *not* raise the syntax error exception, as
  typically clients will want to send invalid syntax to an execution
  backend which might convert the invalid syntax into valid Python via
  one of the dynamic IPython mechanisms.
docstr_tok: ["Return","whether","a","block","of","interactive","input","can","accept","more","input",".","This","method","is","meant","to","be","used","by","line-oriented","frontends",",","who","need","to","guess","whether","a","block","is","complete","or","not","based","solely","on","prior","and","current","input","lines",".","The","InputSplitter","considers","it","has","a","complete","interactive","block","and","will","not","accept","more","input","when","either",":","*","A","SyntaxError","is","raised","*","The","code","is","complete","and","consists","of","a","single","line","or","a","single","non-compound","statement","*","The","code","is","complete","and","has","a","blank","line","at","the","end","If","the","current","input","produces","a","syntax","error",",","this","method","immediately","returns","False","but","does","*","not","*","raise","the","syntax","error","exception",",","as","typically","clients","will","want","to","send","invalid","syntax","to","an","execution","backend","which","might","convert","the","invalid","syntax","into","valid","Python","via","one","of","the","dynamic","IPython","mechanisms","."]
code: def push_accepts_more(self):
      """Return whether a block of interactive input can accept more input.
  
      This method is meant to be used by line-oriented frontends, who need to
      guess whether a block is complete or not based solely on prior and
      current input lines.  The InputSplitter considers it has a complete
      interactive block and will not accept more input when either:
  
      * A SyntaxError is raised
  
      * The code is complete and consists of a single line or a single
        non-compound statement
  
      * The code is complete and has a blank line at the end
  
      If the current input produces a syntax error, this method immediately
      returns False but does *not* raise the syntax error exception, as
      typically clients will want to send invalid syntax to an execution
      backend which might convert the invalid syntax into valid Python via
      one of the dynamic IPython mechanisms.
      """
  
      # With incomplete input, unconditionally accept more
      # A syntax error also sets _is_complete to True - see push()
      if not self._is_complete:
          # print("Not complete")  # debug
          return True
  
      # The user can make any (complete) input execute by leaving a blank line
      last_line = self.source.splitlines()[-1]
      if (not last_line) or last_line.isspace():
          # print("Blank line")  # debug
          return False
  
      # If there's just a single line or AST node, and we're flush left, as is
      # the case after a simple statement such as 'a=1', we want to execute it
      # straight away.
      if self.get_indent_spaces() == 0:
          if len(self.source.splitlines()) <= 1:
              return False
  
          try:
              code_ast = ast.parse("".join(self._buffer))
          except Exception:
              # print("Can't parse AST")  # debug
              return False
          else:
              if len(code_ast.body) == 1 and not hasattr(
                  code_ast.body[0], "body"
              ):
                  # print("Simple statement")  # debug
                  return False
  
      # General fallback - accept more code
      return True
  
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 6 for calling the InputSplitter obj's underlying member method code with example usage: obj.push_accepts_more() and returns: True, True, False, False, False, False