

def choose_part_ranges(content_length, minimum_part_size):
    '\n    Returns a list of (offset, length) for the parts of a large file.\n    '
    assert ((minimum_part_size * 2) <= content_length)
    part_count = min((content_length // minimum_part_size), 10000)
    assert (2 <= part_count)
    part_size = (content_length // part_count)
    last_part_size = (content_length - (part_size * (part_count - 1)))
    assert (minimum_part_size <= last_part_size)
    parts = [((i * part_size), part_size) for i in six.moves.range((part_count - 1))]
    start_of_last = ((part_count - 1) * part_size)
    last_part = (start_of_last, (content_length - start_of_last))
    parts.append(last_part)
    return parts

dataset/ETHPy150Open Backblaze/B2_Command_Line_Tool/b2/utils.py choose_part_ranges/original