code: def _get_colors_from_colormap(
      colormap: str | Colormap,
      num_colors: int,
  ) -> list[Color]:
      """Get colors from colormap."""
      cmap = _get_cmap_instance(colormap)
      return [cmap(num) for num in np.linspace(0, 1, num=num_colors)]
  
imports: from __future__ import annotations
  import itertools
  from typing import TYPE_CHECKING, Collection, Iterator, cast
  import warnings
  import matplotlib
  import matplotlib.colors
  import numpy
  from pandas._typing import MatplotlibColor
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.common import is_list_like
  import pandas.core.common
label_desc: Use image node_id 4 for calling a global function with example usage: _get_colors_from_colormap(colormap, num_colors) and returns: unknown