class_docstr: Format tokens with ANSI color sequences, for output in a text console.
  Color sequences are terminated at newlines, so that paging the output
  works correctly.
  
  The `get_style_defs()` method doesn't do anything special since there is
  no support for common styles.
  
  Options accepted:
  
  `bg`
      Set to ``"light"`` or ``"dark"`` depending on the terminal's background
      (default: ``"light"``).
  
  `colorscheme`
      A dictionary mapping token types to (lightbg, darkbg) color names or
      ``None`` (default: ``None`` = use builtin colorscheme).
  
  `linenos`
      Set to ``True`` to have line numbers on the terminal output as well
      (default: ``False`` = no line numbers).
class_docstr_tok: ["Format","tokens","with","ANSI","color","sequences",",","for","output","in","a","text","console",".","Color","sequences","are","terminated","at","newlines",",","so","that","paging","the","output","works","correctly",".","The","`","get_style_defs","(",")","`","method","does","n't","do","anything","special","since","there","is","no","support","for","common","styles",".","Options","accepted",":","`","bg","`","Set","to","``","``","light","''","``","or","``","``","dark","''","``","depending","on","the","terminal","'s","background","(","default",":","``","``","light","''","``",")",".","`","colorscheme","`","A","dictionary","mapping","token","types","to","(","lightbg",",","darkbg",")","color","names","or","``","None","``","(","default",":","``","None","``","=","use","builtin","colorscheme",")",".","`","linenos","`","Set","to","``","True","``","to","have","line","numbers","on","the","terminal","output","as","well","(","default",":","``","False","``","=","no","line","numbers",")","."]
code: def format_unencoded(self, tokensource, outfile):
      if self.linenos:
          self._write_lineno(outfile)
  
      for ttype, value in tokensource:
          color = self._get_color(ttype)
  
          for line in value.splitlines(True):
              if color:
                  outfile.write(ansiformat(color, line.rstrip("\n")))
              else:
                  outfile.write(line.rstrip("\n"))
              if line.endswith("\n"):
                  if self.linenos:
                      self._write_lineno(outfile)
                  else:
                      outfile.write("\n")
  
      if self.linenos:
          outfile.write("\n")
  
file_path: wandb/wandb/vendor/pygments/formatters/terminal.py
imports: import sys
  from pygments.formatter import Formatter
  from pygments.token import Keyword, Name, Comment, String, Error, Number, Operator, Generic, Token, Whitespace
  from pygments.console import ansiformat
  from pygments.util import get_choice_opt
label_desc: Use image node_id 5 for calling the TerminalFormatter obj's underlying member method code with example usage: obj.format_unencoded(tokensource, outfile) without return types