def _shifted_enumerate(items, start_idx):
  """Yields (index, item) pairs starting from start_idx.

  This function yields the same elements as `enumerate`, but starting from the
  specified start_idx.

  Examples:
    With items = ['a', 'b', 'c'], if start_idx is 0, then this function yields
    (0, 'a'), (1, 'b'), (2, 'c') (the same behavior as `enumerate`), but if
    start_idx is 1, then this function yields (1, 'b'), (2, 'c'), (0, 'a').

  Args:
    items: The list of items to enumerate over.
    start_idx: The index to start yielding at.
  """
  for idx in range(start_idx, start_idx + len(items)):
    shifted_idx = idx % len(items)
    item = items[shifted_idx]
    yield shifted_idx, item
Yields (index, item) pairs starting from start_idx.

  This function yields the same elements as `enumerate`, but starting from the
  specified start_idx.

  Examples:
    With items = ['a', 'b', 'c'], if start_idx is 0, then this function yields
    (0, 'a'), (1, 'b'), (2, 'c') (the same behavior as `enumerate`), but if
    start_idx is 1, then this function yields (1, 'b'), (2, 'c'), (0, 'a').

  Args:
    items: The list of items to enumerate over.
    start_idx: The index to start yielding at.
  
language/compgen/nqg/tasks/mcd_utils.py