def uniqify(seq, idfun=None):
<EOL>if idfun is None:<EOL><INDENT>def idfun(x): return x<EOL><DEDENT>seen = {}<EOL>result = []<EOL>for item in seq:<EOL><INDENT>marker = idfun(item)<EOL>if marker in seen: continue<EOL>seen[marker] = <NUM_LIT:1><EOL>result.append(item)<EOL><DEDENT>return result<EOL>
Relatively fast pure Python uniqification function that preservs ordering.

**Parameters**

        **seq** :  sequence

                Sequence object to uniqify.

        **idfun** :  function, optional

                Optional collapse function to identify items as the same.

**Returns**

        **result** :  list

                Python list with first occurence of each item in `seq`, in
                order.