def cumdims_label(chunks, const):
 return [tuple(zip(((const,) * (1 + len(bds))), accumulate(add, ((0,) + bds)))) for bds in chunks]

def cumdims_label ( chunks , const ) : return [ tuple ( zip ( ( ( const , ) * ( 1 + len ( bds ) ) ) , accumulate ( add , ( ( 0 , ) + bds ) ) ) ) for bds in chunks ]
internal utility for cumulative sum with label .