def METHOD_NAME(data: bytes, chunk_size: int) -> Generator[bytes, None, bytes]:
    # We want to emit chunk_size large chunks, but chunk_size can be larger or smaller than the chunks returned
    # by get_data. We need to yield in a loop to avoid large amounts of data piling up.
    # The loop also avoids copying all data #chunks amount of times by keeping the original data as is.
    chunk_start = 0
    while chunk_start + chunk_size < len(data):
        yield data[chunk_start : chunk_start + chunk_size]
        chunk_start += chunk_size
    data = data[chunk_start:]
    return data