def extract_partial_chunks(iterator, chunks):
    """
    For a given partition, we now know the start and end row numbers, so use that along with the new chunk size
    to break the rows into new (partial) chunks that are labelled with the new index number. Partial chunks will
    be shuffled using the new index number as key to bring together all the partial chunks for a given new index
    number.
    """
    c = chunks[0]
    key, val = list(iterator)
    k_i, k_i_next = key
    tuples = []
    for x in range(k_i - k_i % c, k_i_next, c):
        start, end = max(k_i, x), min(k_i_next, x + c)
        start_offset, end_offset = start - k_i, end - k_i
        partial_chunk = val[start_offset:end_offset]
        new_index = start // c
        new_start_offset, new_end_offset = (start - new_index * c, end - 
            new_index * c)
        tuples.append((new_index, ((new_start_offset, new_end_offset),
            partial_chunk)))
    return tuples
