class_docstr: Format colored Python source.
      
class_docstr_tok: ["Format","colored","Python","source","."]
docstr: like call but write to a temporary buffer
docstr_tok: ["like","call","but","write","to","a","temporary","buffer"]
code: def _inner_call_(self, toktype, toktext, start_pos):
      """like call but write to a temporary buffer"""
      buff = StringIO()
      srow, scol = start_pos
      colors = self.colors
      owrite = buff.write
  
      # line separator, so this works across platforms
      linesep = os.linesep
  
      # calculate new positions
      oldpos = self.pos
      newpos = self.lines[srow] + scol
      self.pos = newpos + len(toktext)
  
      # send the original whitespace, if needed
      if newpos > oldpos:
          owrite(self.raw[oldpos:newpos])
  
      # skip indenting tokens
      if toktype in [token.INDENT, token.DEDENT]:
          self.pos = newpos
          buff.seek(0)
          return buff.read()
  
      # map token type to a color group
      if token.LPAR <= toktype <= token.OP:
          toktype = token.OP
      elif toktype == token.NAME and keyword.iskeyword(toktext):
          toktype = _KEYWORD
      color = colors.get(toktype, colors[_TEXT])
  
      # Triple quoted strings must be handled carefully so that backtracking
      # in pagers works correctly. We need color terminators on _each_ line.
      if linesep in toktext:
          toktext = toktext.replace(
              linesep, "%s%s%s" % (colors.normal, linesep, color)
          )
  
      # send text
      owrite("%s%s%s" % (color, toktext, colors.normal))
      buff.seek(0)
      return buff.read()
  
file_path: catboost/contrib/python/ipython/py3/IPython/utils/PyColorize.py
imports: import keyword
  import os
  import sys
  import token
  import tokenize
  from IPython.utils.coloransi import TermColors, InputTermColors, ColorScheme, ColorSchemeTable
  from .colorable import Colorable
  from io import StringIO
label_desc: Use image node_id 4 for calling the Parser obj's underlying member method code with example usage: obj._inner_call_(toktype, toktext, start_pos) and returns: buff, buff