from typing import List
from typing import Tuple


def _split_chunk_bounds(
    start: int, stop: int, multiple: int,
) -> List[Tuple[int, int]]:
  # pylint: disable=g-doc-args
  # pylint: disable=g-doc-return-or-yield
  """Calculate the size of divided chunks along a dimension.

  Example usage:

    >>> _split_chunk_bounds(0, 10, 3)
    [(0, 3), (3, 6), (6, 9), (9, 10)]
    >>> _split_chunk_bounds(5, 10, 3)
    [(5, 6), (6, 9), (9, 10)]
    >>> _split_chunk_bounds(10, 20, 12)
    [(10, 12), (12, 20)]
  """
  if multiple == -1:
    return [(start, stop)]
  assert start >= 0 and stop > start and multiple > 0, (start, stop, multiple)
  first_multiple = (start // multiple + 1) * multiple
  breaks = list(range(first_multiple, stop, multiple))
  return list(zip([start] + breaks, breaks + [stop]))