code: def repeat(sequence: Sequence[int]) -> partial[Callable[[], None]]:
      """Return a driver function that can advance a repeated of values.
  
      .. code-block:: none
  
          seq = [0, 1, 2, 3]
  
          # repeat(seq) => [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, ...]
  
      Args:
          sequence (seq) : a sequence of values for the driver to bounce
  
      """
      N = len(sequence)
  
      def f(i: int) -> int:
          return sequence[i % N]
  
      return partial(force, sequence=_advance(f))
  
file_path: bokeh/src/bokeh/driving.py
imports: from __future__ import annotations
  import logging
  from functools import partial
  from typing import Any, Callable, Iterable, Iterator, Sequence, TypeVar
label_desc: Use image node_id 6 for calling a global function with example usage: repeat(sequence) and returns: partial, sequence