#NEWLINE# def transversal2coset( size , base , transversal ) : #NEWLINE# #INDENT# a = [ ] #NEWLINE# j = 0 #NEWLINE# for i in range ( size ) : #NEWLINE# #INDENT# if ( i in base ) : #NEWLINE# #INDENT# a . append ( sorted ( transversal [ j ] . values ( ) ) ) #NEWLINE# j += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# a . append ( [ list ( range ( size ) ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# j = ( len ( a ) - 1 ) #NEWLINE# while ( a [ j ] == [ list ( range ( size ) ) ] ) : #NEWLINE# #INDENT# j -= 1 #NEWLINE# #UNINDENT# return a [ : ( j + 1 ) ]