class_docstr: Cache which maps (r, g, b) tuples to 16 ansi colors.
  
  :param bg: Cache for background colors, instead of foreground.
docstr: Return a (ansi_code, ansi_name) tuple. (E.g. ``(44, 'ansiblue')``.) for
  a given (r,g,b) value.
docstr_tok: ["Return","a","(","ansi_code",",","ansi_name",")","tuple",".","(","E.g",".","``","(","44",",","'ansiblue","'",")","``",".",")","for","a","given","(","r",",","g",",","b",")","value","."]
code: def get_code(self, value, exclude=()):
      """
      Return a (ansi_code, ansi_name) tuple. (E.g. ``(44, 'ansiblue')``.) for
      a given (r,g,b) value.
      """
      key = (value, exclude)
      if key not in self:
          self[key] = self._get(value, exclude)
      return self[key]
  
imports: from __future__ import unicode_literals
  from prompt_toolkit.filters import to_simple_filter, Condition
  from prompt_toolkit.layout.screen import Size
  from prompt_toolkit.renderer import Output
  from prompt_toolkit.styles import ANSI_COLOR_NAMES
  from six.moves import range
  import array
  import errno
  import os
  import six
label_desc: Use image node_id 2 for calling the _16ColorCache obj's underlying member method code with example usage: obj.get_code(value, exclude) and returns: self