<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def unique(seq, idfunc=None):
 	""" 	Unique a list or tuple and preserve the order 	@type idfunc: Function or None 	@param idfunc: If idfunc is provided it will be called during the 	comparison process. 	"""

	if idfunc is None:
		idfunc = lambda x: x
	preserved_type = type(seq)
	seen = {}
	result = []
	for item in seq:
		marker = idfunc(item)
		if marker in seen:
			continue
		seen[marker] = 1
		result.append(item)
	return preserved_type(result)