code: def _create_ansi_color_dict(
      color_cls: type[FOREGROUND_COLOR] | type[BACKGROUND_COLOR],
  ) -> dict[str, int]:
      "Create a table that maps the 16 named ansi colors to their Windows code."
      return {
          "ansidefault": color_cls.BLACK,
          "ansiblack": color_cls.BLACK,
          "ansigray": color_cls.GRAY,
          "ansibrightblack": color_cls.BLACK | color_cls.INTENSITY,
          "ansiwhite": color_cls.GRAY | color_cls.INTENSITY,
          # Low intensity.
          "ansired": color_cls.RED,
          "ansigreen": color_cls.GREEN,
          "ansiyellow": color_cls.YELLOW,
          "ansiblue": color_cls.BLUE,
          "ansimagenta": color_cls.MAGENTA,
          "ansicyan": color_cls.CYAN,
          # High intensity.
          "ansibrightred": color_cls.RED | color_cls.INTENSITY,
          "ansibrightgreen": color_cls.GREEN | color_cls.INTENSITY,
          "ansibrightyellow": color_cls.YELLOW | color_cls.INTENSITY,
          "ansibrightblue": color_cls.BLUE | color_cls.INTENSITY,
          "ansibrightmagenta": color_cls.MAGENTA | color_cls.INTENSITY,
          "ansibrightcyan": color_cls.CYAN | color_cls.INTENSITY,
      }
  
imports: from __future__ import annotations
  import sys
  import os
  from ctypes import ArgumentError, byref, c_char, c_long, c_uint, c_ulong, pointer
  from ctypes.wintypes import DWORD, HANDLE
  from typing import Callable, TextIO, TypeVar
  from prompt_toolkit.cursor_shapes import CursorShape
  from prompt_toolkit.data_structures import Size
  from prompt_toolkit.styles import ANSI_COLOR_NAMES, Attrs
  from prompt_toolkit.utils import get_cwidth
  from prompt_toolkit.win32_types import CONSOLE_SCREEN_BUFFER_INFO, COORD, SMALL_RECT, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE
  from ..utils import SPHINX_AUTODOC_RUNNING
  from .base import Output
  from .color_depth import ColorDepth
label_desc: Use image node_id 2 for calling a global function with example usage: _create_ansi_color_dict(color_cls) and returns: dict