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: A class method that returns True if the current platform supports
  coloring terminal output using this method. Returns False otherwise.
docstr_tok: ["A","class","method","that","returns","True","if","the","current","platform","supports","coloring","terminal","output","using","this","method",".","Returns","False","otherwise","."]
code: def supported(cls, stream=sys.stdout):
      """
      A class method that returns True if the current platform supports
      coloring terminal output using this method. Returns False otherwise.
      """
      if not stream.isatty():
          return False  # auto color only on TTYs
      try:
          import curses
      except ImportError:
          return False
      else:
          try:
              try:
                  return curses.tigetnum("colors") > 2
              except curses.error:
                  curses.setupterm()
                  return curses.tigetnum("colors") > 2
          except:
              raise
              # guess false in case of error
              return False
  
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 2 for calling the _AnsiColorizer obj's underlying member method code with example usage: obj.supported(cls, stream) and returns: False, False, unknown, False, unknown