code: def _derive_colors(
      *,
      color: Color | Collection[Color] | None,
      colormap: str | Colormap | None,
      color_type: str,
      num_colors: int,
  ) -> list[Color]:
      """
      Derive colors from either `colormap`, `color_type` or `color` inputs.
  
      Get a list of colors either from `colormap`, or from `color`,
      or from `color_type` (if both `colormap` and `color` are None).
  
      Parameters
      ----------
      color : str or sequence, optional
          Color(s) to be used for deriving sequence of colors.
          Can be either be a single color (single color string, or sequence of floats
          representing a single color), or a sequence of colors.
      colormap : :py:class:`matplotlib.colors.Colormap`, optional
          Matplotlib colormap.
          When provided, the resulting colors will be derived from the colormap.
      color_type : {"default", "random"}, optional
          Type of colors to derive. Used if provided `color` and `colormap` are None.
          Ignored if either `color` or `colormap`` are not None.
      num_colors : int
          Number of colors to be extracted.
  
      Returns
      -------
      list
          List of colors extracted.
  
      Warns
      -----
      UserWarning
          If both `colormap` and `color` are provided.
          Parameter `color` will override.
      """
      if color is None and colormap is not None:
          return _get_colors_from_colormap(
              colormap, num_colors=num_colors
          )
      elif color is not None:
          if colormap is not None:
              warnings.warn(
                  "'color' and 'colormap' cannot be used simultaneously. Using 'color'",
                  stacklevel=find_stack_level(),
              )
          return _get_colors_from_color(color)
      else:
          return _get_colors_from_color_type(
              color_type, num_colors=num_colors
          )
  
imports: from __future__ import annotations
  from collections.abc import Collection, Iterator, Sequence
  import itertools
  from typing import TYPE_CHECKING, cast, overload
  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 5 for calling a global function with example usage: _derive_colors() and returns: _get_colors_from_colormap, _get_colors_from_color, _get_colors_from_color_type