Yields unique items from *iterable* whilst preserving the original order.
433259
def unique(cls, iterable, key=None):
    

    if key is None:
      key = lambda x: x
    def generator():
      seen = set()
      seen_add = seen.add
      for item in iterable:
        key_val = key(item)
        if key_val not in seen:
          seen_add(key_val)
          yield item
    return cls(generator())
1124486
def unique_inverse(item_list):
    
    import utool as ut
    unique_items = ut.unique(item_list)
    inverse = list_alignment(unique_items, item_list)
    return unique_items, inverse
724532
def flatten(items):
    
    for x in items:
        if isinstance(x, Iterable):
            yield from flatten(x)
        else:
            yield x
1134570
def de_duplicate(items):
    
    result = []
    for item in items:
        if item not in result:
            result.append(item)
    return result
704026
def nonuniq(iterable):
	
	temp_dict = {}
	for e in iterable:
		if e in temp_dict:
			yield e
		temp_dict.setdefault(e, e)
366360
def unique_deps(deps):
    """"""
    deps.sort()
    return list(k for k, _ in itertools.groupby(deps))
464364
def unique(seq):
    
    seen = set()
    return (x for x in seq if x not in seen and not seen.add(x))
231564
def iflag_unique_items(list_):
    
    seen = set()
    def unseen(item):
        if item in seen:
            return False
        seen.add(item)
        return True
    flag_iter = (unseen(item) for item in list_)
    return flag_iter
399190
def randiter(iterable):
    '''
'''

    iter_len = len(iterable)

    for index in xrandrange(iter_len):
        yield iterable[index]
50090
def enumerate(self, **kwargs):
        '''
        '''
        for item in self.set.enumerate(**kwargs):
            yield flattened(item)
372960
def itertypes(iterable):
    """"""
    seen = set()
    for entry in iterable:
        if isinstance(entry, tuple):
            for type_ in entry:
                if type_ not in seen:
                    seen.add(type_)
                    yield type_
        else:
            if entry not in seen:
                seen.add(entry)
                yield entry
52227
def unique(seq):
    """"""
    seen = {}
    result = []
    for item in seq:
        marker = item
        if marker in seen:
            continue
        seen[marker] = 1
        result.append(item)
    return result
562525
def unique(iterable):
    
    seen = set()
    for obj in iterable:
        if obj not in seen:
            yield obj
            seen.add(obj)
1191435
def items(iterable):
    
    if hasattr(iterable, 'iteritems'):
        return (p for p in iterable.iteritems())
    elif hasattr(iterable, 'items'):
        return (p for p in iterable.items())
    else:
        return (p for p in enumerate(iterable))
1178550
def dedupe(items):
    
    seen = set()
    for item in items:
        if item not in seen:
            yield item
            seen.add(item)
279300
def unique(seq, idfunc=None):
	
	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)
916768
def unique_iterator(seq):
    
    seen = set()
    for item in seq:
        if item not in seen:
            seen.add(item)
            yield item