class_docstr: Remove matching input prompts from a block of input.
  
  Parameters
  ----------
  prompt_re : regular expression
      A regular expression matching any input prompt (including continuation,
      e.g. ``...``)
  initial_re : regular expression, optional
      A regular expression matching only the initial prompt, but not continuation.
      If no initial expression is given, prompt_re will be used everywhere.
      Used mainly for plain Python prompts (``>>>``), where the continuation prompt
      ``...`` is a valid Python expression in Python 3, so shouldn't be stripped.
  
  Notes
  -----
  
  If initial_re and prompt_re differ,
  only initial_re will be tested against the first line.
  If any prompt is found on the first two lines,
  prompts will be stripped from the rest of the block.
class_docstr_tok: ["Remove","matching","input","prompts","from","a","block","of","input",".","Parameters","--","--","--","--","--","prompt_re",":","regular","expression","A","regular","expression","matching","any","input","prompt","(","including","continuation",",","e.g",".","``","...","``",")","initial_re",":","regular","expression",",","optional","A","regular","expression","matching","only","the","initial","prompt",",","but","not","continuation",".","If","no","initial","expression","is","given",",","prompt_re","will","be","used","everywhere",".","Used","mainly","for","plain","Python","prompts","(","``",">",">",">","``",")",",","where","the","continuation","prompt","``","...","``","is","a","valid","Python","expression","in","Python","3",",","so","should","n't","be","stripped",".","Notes","--","--","-","If","initial_re","and","prompt_re","differ",",","only","initial_re","will","be","tested","against","the","first","line",".","If","any","prompt","is","found","on","the","first","two","lines",",","prompts","will","be","stripped","from","the","rest","of","the","block","."]
code: def __init__(self, prompt_re, initial_re=None):
      self.prompt_re = prompt_re
      self.initial_re = initial_re or prompt_re
  
imports: import ast
  from codeop import CommandCompiler, Compile
  import re
  import sys
  import tokenize
  from typing import List, Tuple, Optional, Any
  import warnings
  from IPython.utils import tokenutil
label_desc: Use image node_id 1 to create a new PromptStripper object  with example: obj = PromptStripper(prompt_re, initial_re)