class_docstr: Console attribute and special drawing characters and functions accessor.
  
  Use GetConsoleAttr() to get a global ConsoleAttr object shared by all callers.
  Use ConsoleAttr() for abstracting multiple consoles.
  
  If _out is not associated with a console, or if the console properties cannot
  be determined, the default behavior is ASCII art with no attributes.
  
  Attributes:
    _ANSI_COLOR: The ANSI color control sequence dict.
    _ANSI_COLOR_RESET: The ANSI color reset control sequence string.
    _csi: The ANSI Control Sequence indicator string, '' if not supported.
    _encoding: The character encoding.
        ascii: ASCII art. This is the default.
        utf8: UTF-8 unicode.
        win: Windows code page 437.
    _font_bold: The ANSI bold font embellishment code string.
    _font_italic: The ANSI italic font embellishment code string.
    _get_raw_key: A function that reads one keypress from stdin with no echo.
    _out: The console output file stream.
    _term: TERM environment variable value.
    _term_size: The terminal (x, y) dimensions in characters.
class_docstr_tok: ["Console","attribute","and","special","drawing","characters","and","functions","accessor",".","Use","GetConsoleAttr","(",")","to","get","a","global","ConsoleAttr","object","shared","by","all","callers",".","Use","ConsoleAttr","(",")","for","abstracting","multiple","consoles",".","If","_out","is","not","associated","with","a","console",",","or","if","the","console","properties","can","not","be","determined",",","the","default","behavior","is","ASCII","art","with","no","attributes",".","Attributes",":","_ANSI_COLOR",":","The","ANSI","color","control","sequence","dict",".","_ANSI_COLOR_RESET",":","The","ANSI","color","reset","control","sequence","string",".","_csi",":","The","ANSI","Control","Sequence","indicator","string",",","``","if","not","supported",".","_encoding",":","The","character","encoding",".","ascii",":","ASCII","art",".","This","is","the","default",".","utf8",":","UTF-8","unicode",".","win",":","Windows","code","page","437",".","_font_bold",":","The","ANSI","bold","font","embellishment","code","string",".","_font_italic",":","The","ANSI","italic","font","embellishment","code","string",".","_get_raw_key",":","A","function","that","reads","one","keypress","from","stdin","with","no","echo",".","_out",":","The","console","output","file","stream",".","_term",":","TERM","environment","variable","value",".","_term_size",":","The","terminal","(","x",",","y",")","dimensions","in","characters","."]
docstr: Generates a colorized string, optionally justified.
  
  Args:
    string: The string to write.
    color: The color name -- must be in _ANSI_COLOR.
    justify: The justification function, no justification if None. For
      example, justify=lambda s: s.center(10)
  
  Returns:
    str, The colorized string that can be printed to the console.
docstr_tok: ["Generates","a","colorized","string",",","optionally","justified",".","Args",":","string",":","The","string","to","write",".","color",":","The","color","name","--","must","be","in","_ANSI_COLOR",".","justify",":","The","justification","function",",","no","justification","if","None",".","For","example",",","justify=lambda","s",":","s.center","(","10",")","Returns",":","str",",","The","colorized","string","that","can","be","printed","to","the","console","."]
code: def Colorize(self, string, color, justify=None):
      """Generates a colorized string, optionally justified.
  
      Args:
        string: The string to write.
        color: The color name -- must be in _ANSI_COLOR.
        justify: The justification function, no justification if None. For
          example, justify=lambda s: s.center(10)
  
      Returns:
        str, The colorized string that can be printed to the console.
      """
      if justify:
          string = justify(string)
      if self._csi and color in self._ANSI_COLOR:
          return "{csi}{color_code}{string}{csi}{reset_code}".format(
              csi=self._csi,
              color_code=self._ANSI_COLOR[color],
              reset_code=self._ANSI_COLOR_RESET,
              string=string,
          )
      # TODO: Add elif self._encoding == 'cp437': code here.
      return string
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import unicode_literals
  import os
  import sys
  import unicodedata
  from fire.console import console_attr_os
  from fire.console import encoding
  from fire.console import text
  import six
label_desc: Use image node_id 3 for calling the ConsoleAttr obj's underlying member method code with example usage: obj.Colorize(string, color, justify) and returns: string, str