from typing import Tuple


async def _next_offset(end, entities) -> Tuple[int, bool]:
    """Find out how much length we need to skip ahead for the next entities"""
    last_chunk = False
    if len(entities) >= end + 1:
        next_offset = entities[end].offset
    else:
        # It's always the last entity so just grab the last index
        next_offset = entities[-1].offset + entities[-1].length
        last_chunk = True
    return next_offset, last_chunk