def unique_combinations(items, n):
 if (n == 0):
  (yield [])
 else:
  for i in xrange(((len(items) - n) + 1)):
   for cc in unique_combinations(items[(i + 1):], (n - 1)):
    (yield ([items[i]] + cc))

def unique_combinations ( items , n ) : if ( n == 0 ) : ( yield [ ] ) else : for i in xrange ( ( ( len ( items ) - n ) + 1 ) ) : for cc in unique_combinations ( items [ ( i + 1 ) : ] , ( n - 1 ) ) : ( yield ( [ items [ i ] ] + cc ) )
return n-length tuples .