#NEWLINE# def combos( seq , max_len = None ) : #NEWLINE# #INDENT# seq = list ( max_len ) #NEWLINE# for length in range ( 0 , ( max_len or ( len ( seq ) + 1 ) ) ) : #NEWLINE# #INDENT# for combo in itertools . combinations ( seq , length ) : #NEWLINE# #INDENT# ( yield combo )