#NEWLINE# def UniqueCombinations( items , n ) : #NEWLINE# #INDENT# if ( n == 0 ) : #NEWLINE# #INDENT# ( yield [ ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for i in xrange ( len ( items ) ) : #NEWLINE# #INDENT# for cc in UniqueCombinations ( items [ ( i + 1 ) : ] , ( n - 1 ) ) : #NEWLINE# #INDENT# ( yield ( [ items [ i ] ] + cc ) )