class_docstr: Format tokens as a raw representation for storing token streams.
  
  The format is ``tokentype<TAB>repr(tokenstring)\n``. The output can later
  be converted to a token stream with the `RawTokenLexer`, described in the
  :doc:`lexer list <lexers>`.
  
  Only two options are accepted:
  
  `compress`
      If set to ``'gz'`` or ``'bz2'``, compress the output with the given
      compression algorithm after encoding (default: ``''``).
  `error_color`
      If set to a color name, highlight error tokens using that color.  If
      set but with no value, defaults to ``'red'``.
  
      .. versionadded:: 0.11
class_docstr_tok: ["Format","tokens","as","a","raw","representation","for","storing","token","streams",".","The","format","is","``","tokentype","<","TAB",">","repr","(","tokenstring",")","\\n","``",".","The","output","can","later","be","converted","to","a","token","stream","with","the","`","RawTokenLexer","`",",","described","in","the",":","doc",":","`","lexer","list","<","lexers",">","`",".","Only","two","options","are","accepted",":","`","compress","`","If","set","to","``","'gz","'","``","or","``","'bz2","'","``",",","compress","the","output","with","the","given","compression","algorithm","after","encoding","(","default",":","``","``","``",")",".","`","error_color","`","If","set","to","a","color","name",",","highlight","error","tokens","using","that","color",".","If","set","but","with","no","value",",","defaults","to","``","'red","'","``",".","..","versionadded",":",":","0.11"]
code: def __init__(self, **options):
      Formatter.__init__(self, **options)
      # We ignore self.encoding if it is set, since it gets set for lexer
      # and formatter if given with -Oencoding on the command line.
      # The RawTokenFormatter outputs only ASCII. Override here.
      self.encoding = (
          "ascii"  # let pygments.format() do the right thing
      )
      self.compress = get_choice_opt(
          options, "compress", ["", "none", "gz", "bz2"], ""
      )
      self.error_color = options.get("error_color", None)
      if self.error_color is True:
          self.error_color = "red"
      if self.error_color is not None:
          try:
              colorize(self.error_color, "")
          except KeyError:
              raise ValueError(
                  "Invalid color %r specified" % self.error_color
              )
  
file_path: catboost/contrib/python/Pygments/py2/pygments/formatters/other.py
imports: from pygments.formatter import Formatter
  from pygments.util import get_choice_opt
  from pygments.token import Token
  from pygments.console import colorize
label_desc: Use image node_id 1 to create a new RawTokenFormatter object from inherited base classes: Formatter with example: obj = RawTokenFormatter()