#NEWLINE# def _triang_to_flat_pure( L ) : #NEWLINE# #INDENT# ( D , _ , M ) = L . shape #NEWLINE# N = ( ( M * ( M + 1 ) ) // 2 ) #NEWLINE# flat = np . empty ( ( N , D ) ) #NEWLINE# for d in range ( D ) : #NEWLINE# #INDENT# count = 0 #NEWLINE# for m in range ( M ) : #NEWLINE# #INDENT# for mm in range ( ( m + 1 ) ) : #NEWLINE# #INDENT# flat [ ( count , d ) ] = L [ ( d , m , mm ) ] #NEWLINE# count = ( count + 1 ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return flat