def next_chunk(current: int,
               length: int,
               desired: int):
    """
    This is a helper function that can be used whenever you want to access a large sequence
    of data in chunks. It simply carries out the calculation that returns the extents of the
    next chunk taking into account the ``length`` of the sequence. The sequence itself is not
    required here, only the length.
    :param current: the starting point of the chunk
    :param length: the length of the sequence being chunked
    :param desired: the requested length of the chunk
    :return: A tuple of the chunk extents. The first value is inclusive; the second is exclusive
    """
    if current + desired < length:
        return current, current + desired
    else:
        return current, length