class_docstr: This metaclass enables ColorGroup class types to be used like simple
  enumerations.
class_docstr_tok: ["This","metaclass","enables","ColorGroup","class","types","to","be","used","like","simple","enumerations","."]
code: def __getitem__(self, v: str | int) -> NamedColor:
      from . import named
  
      if isinstance(v, str):
          if v in self._colors:
              return getattr(named, v.lower())
          raise KeyError(
              f"Color group {self.__class__.__name__!r} has no color {v!r}"
          )
      if isinstance(v, int):
          if v >= 0 and v < len(self):
              return getattr(named, self._colors[v].lower())
          raise IndexError(
              f"Index out of range for color group {self.__class__.__name__!r}"
          )
      raise ValueError(
          f"Unknown index {v!r} for color group {self.__class__.__name__!r}"
      )
  
file_path: bokeh/src/bokeh/colors/util.py
imports: from __future__ import annotations
  import logging
  from typing import ClassVar, Iterator
  from .color import RGB
label_desc: Use image node_id 2 for calling the _ColorGroupMeta obj's underlying member method code with example usage: obj.__getitem__(v) and returns: getattr, getattr