def unique(seq):
seen = {}<EOL>result = []<EOL>for item in seq:<EOL><INDENT>marker = item<EOL>if marker in seen:<EOL><INDENT>continue<EOL><DEDENT>seen[marker] = <NUM_LIT:1><EOL>result.append(item)<EOL><DEDENT>return result<EOL>
Helper function to include only unique monomials in a basis.