#NEWLINE# def cartesian( max_chars , max_nums , unique = False ) : #NEWLINE# #INDENT# res = [ '' . join ( prod [ 0 ] ) for prod in product ( combochars ( max_chars , 2 ) , range ( 0 , max_nums ) ) ] #NEWLINE# if unique : #NEWLINE# #INDENT# return list ( set ( res ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return res