class_docstr: A colorizer is an object that loosely wraps around a stream, allowing
  callers to write text to the stream in a particular color.
  
  Colorizer classes must implement C{supported()} and C{write(text, color)}.
class_docstr_tok: ["A","colorizer","is","an","object","that","loosely","wraps","around","a","stream",",","allowing","callers","to","write","text","to","the","stream","in","a","particular","color",".","Colorizer","classes","must","implement","C","{","supported","(",")","}","and","C","{","write","(","text",",","color",")","}","."]
docstr: Write the given text to the stream in the given color.
  
  @param text: Text to be written to the stream.
  
  @param color: A string label for a color. e.g. 'red', 'white'.
docstr_tok: ["Write","the","given","text","to","the","stream","in","the","given","color",".","@","param","text",":","Text","to","be","written","to","the","stream",".","@","param","color",":","A","string","label","for","a","color",".","e.g",".","'red","'",",","'white","'","."]
code: def write(self, text, color):
      """
      Write the given text to the stream in the given color.
  
      @param text: Text to be written to the stream.
  
      @param color: A string label for a color. e.g. 'red', 'white'.
      """
      color = self._colors[color]
      self.stream.write("\x1b[%sm%s\x1b[0m" % (color, text))
  
imports: import numpy
  import logging
  import subprocess
  import os
  import torch
  from collections import OrderedDict
  import plotting
  import sys
  import importlib.util
  import pandas
  import pickle
label_desc: Use image node_id 3 for calling the _AnsiColorizer obj's underlying member method code with example usage: obj.write(text, color) without return types