parameters: (length, n)
return_statement: return result
docstring: 并行数据分解，把计算量分解成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)]
docstring_summary: 并行数据分解，把计算量分解成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)]
docstring_tokens: 并行数据分解，把计算量分解成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 ) ]
function: 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
function_tokens: 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