(length, n)
return result
并行数据分解，把计算量分解成n块
    >>> split_data(10, 4)
    [(0, 3), (3, 6), (6, 9), (9, 10)]
    >>> split_data(101, 4)
    [(0, 26), (26, 52), (52, 78), (78, 101)]
并行数据分解，把计算量分解成n块
    >>> split_data(10, 4)
    [(0, 3), (3, 6), (6, 9), (9, 10)]
    >>> split_data(101, 4)
    [(0, 26), (26, 52), (52, 78), (78, 101)]
并行数据分解，把计算量分解成n块 >>> split_data ( 10 4 ) [ ( 0 3 ) ( 3 6 ) ( 6 9 ) ( 9 10 ) ] >>> split_data ( 101 4 ) [ ( 0 26 ) ( 26 52 ) ( 52 78 ) ( 78 101 ) ]
def split_data(length, n):
    '''并行数据分解，把计算量分解成n块
    >>> split_data(10, 4)
    [(0, 3), (3, 6), (6, 9), (9, 10)]
    >>> split_data(101, 4)
    [(0, 26), (26, 52), (52, 78), (78, 101)]
    '''
    if n > length: raise ValueError()

    result = []
    for i in xrange(length):
        block_size = (length / n + 1)
        if i % block_size == 0:
            begin = i
            end = i + block_size
            end = length if end > length else end
            result.append((begin, end))
    return result
def split_data ( length , n ) : if n > length : raise ValueError ( ) result = [ ] for i in xrange ( length ) : block_size = ( length / n + 1 ) if i % block_size == 0 : begin = i end = i + block_size end = length if end > length else end result . append ( ( begin , end ) ) return result