code: def color_scheme_to_cycler(scheme):
      """Convert a color scheme to a Cycler.
  
      Parameters
      ----------
      scheme : str, int, or _vtk.vtkColorSeries
          Color scheme to be converted. If a string, it should correspond to a
          valid color scheme name (e.g., 'viridis'). If an integer, it should
          correspond to a valid color scheme ID. If an instance of
          `_vtk.vtkColorSeries`, it should be a valid color series.
  
      Returns
      -------
      cycler.Cycler
          A Cycler object with the color scheme.
  
      Raises
      ------
      ValueError
          If the provided `scheme` is not a valid color scheme.
      """
      if not isinstance(scheme, _vtk.vtkColorSeries):
          series = _vtk.vtkColorSeries()
          if isinstance(scheme, str):
              series.SetColorScheme(
                  COLOR_SCHEMES.get(scheme.lower())["id"]
              )
          elif isinstance(scheme, int):
              series.SetColorScheme(scheme)
          else:
              raise ValueError(f"Color scheme not understood: {scheme}")
      else:
          series = scheme
      colors = (
          series.GetColor(i) for i in range(series.GetNumberOfColors())
      )
      return cycler("color", colors)
  
imports: from __future__ import annotations
  import inspect
  from typing import Optional, Tuple, Union
  from cycler import Cycler, cycler
  from matplotlib.colors import ListedColormap
  import matplotlib.pyplot
  import numpy
  import pyvista
  from pyvista.core.utilities.misc import has_module
  from .None import _vtk
  from ._typing import ColorLike
label_desc: Use image node_id 5 for calling a global function with example usage: color_scheme_to_cycler(scheme) and returns: cycler