class_docstr: This object maintains the state of a virtual text screen as a
  rectangular array. This maintains a virtual cursor position and handles
  scrolling as characters are added. This supports most of the methods needed
  by an ANSI text screen. Row and column indexes are 1-based (not zero-based,
  like arrays).
  
  Characters are represented internally using unicode. Methods that accept
  input characters, when passed 'bytes' (which in Python 2 is equivalent to
  'str'), convert them from the encoding specified in the 'encoding'
  parameter to the constructor. Methods that return screen contents return
  unicode strings, with the exception of __str__() under Python 2. Passing
  ``encoding=None`` limits the API to only accept unicode input, so passing
  bytes in will raise :exc:`TypeError`.
class_docstr_tok: ["This","object","maintains","the","state","of","a","virtual","text","screen","as","a","rectangular","array",".","This","maintains","a","virtual","cursor","position","and","handles","scrolling","as","characters","are","added",".","This","supports","most","of","the","methods","needed","by","an","ANSI","text","screen",".","Row","and","column","indexes","are","1-based","(","not","zero-based",",","like","arrays",")",".","Characters","are","represented","internally","using","unicode",".","Methods","that","accept","input","characters",",","when","passed","'bytes","'","(","which","in","Python","2","is","equivalent","to","'str","'",")",",","convert","them","from","the","encoding","specified","in","the","'encoding'","parameter","to","the","constructor",".","Methods","that","return","screen","contents","return","unicode","strings",",","with","the","exception","of","__str__","(",")","under","Python","2",".","Passing","``","encoding=None","``","limits","the","API","to","only","accept","unicode","input",",","so","passing","bytes","in","will","raise",":","exc",":","`","TypeError","`","."]
docstr: This initializes a blank screen of the given dimensions.
docstr_tok: ["This","initializes","a","blank","screen","of","the","given","dimensions","."]
code: def __init__(
      self, r=24, c=80, encoding="latin-1", encoding_errors="replace"
  ):
      """This initializes a blank screen of the given dimensions."""
  
      self.rows = r
      self.cols = c
      self.encoding = encoding
      self.encoding_errors = encoding_errors
      if encoding is not None:
          self.decoder = codecs.getincrementaldecoder(encoding)(
              encoding_errors
          )
      else:
          self.decoder = None
      self.cur_r = 1
      self.cur_c = 1
      self.cur_saved_r = 1
      self.cur_saved_c = 1
      self.scroll_row_start = 1
      self.scroll_row_end = self.rows
      self.w = [[SPACE] * self.cols for _ in range(self.rows)]
  
imports: import codecs
  import copy
  import sys
  import warnings
label_desc: Use image node_id 1 to create a new screen object  with example: obj = screen(r, c, encoding, encoding_errors)