Return a list of dictionaries which are sorted for only unique entries.

    :param dlist:
    :param key:
    :return list:
979033
def unique_list_dicts(dlist, key):
    

    return list(dict((val[key], val) for val in dlist).values())
1269679
def sort_list_of_dicts(lst_of_dct, keys, reverse=False, **sort_args):
    

    if type(keys) != list:
        keys = [keys]
    # dcmdir = lst_of_dct[:]
    # lst_of_dct.sort(key=lambda x: [x[key] for key in keys], reverse=reverse, **sort_args)
    lst_of_dct.sort(key=lambda x: [((False, x[key]) if key in x else (True, 0)) for key in keys], reverse=reverse, **sort_args)
    return lst_of_dct
920194
def remove_duplicates(list_to_prune: List) -> List:
    
    temp_dict = collections.OrderedDict()
    for item in list_to_prune:
        temp_dict[item] = None

    return list(temp_dict.keys())
708161
def distinct(keys):
    
    known = set()
    outlist = []
    for key in keys:
        if key not in known:
            outlist.append(key)
        known.add(key)
    return outlist
1281315
def groupby_dict(dictionary, key):
    ''' 
    '''
    return dict((k, list(g)) for k, g in itertools.groupby(sorted(dictionary.keys(), key=lambda name: dictionary[name][key]), key=lambda name: dictionary[name][key]))
734181
def multidict(D):
    ''''''
    keys = list(D.keys())
    if len(keys) == 0:
        return [[]]
    try:
        N = len(D[keys[0]])
        islist = True
    except:
        N = 1
        islist = False
    dlist = [dict() for d in range(N)]
    for k in keys:
        if islist:
            for i in range(N):
                dlist[i][k] = D[k][i]
        else:
            dlist[0][k] = D[k]
    return [keys]+dlist
373563
def sort(self, *, key: Optional[Callable[[Any], Any]] = None, reverse: bool = False) -> None:
        
        return list.sort(self, key=self._sort_key(key), reverse=reverse)
614254
def str2dict_keys(str_in):
    '''
    
    '''
    tmp_dict = str2dict(str_in)
    if tmp_dict is None:
        return None
    return sorted([k for k in tmp_dict])
397425
def dict_filter(d, exclude=[]):
    

    if isinstance(d, list):
        ret = []
        for e in d:
            ret.append(dict_filter(e, exclude))
        return ret
    elif isinstance(d, dict):
        ret = {}
        for k, v in d.items():
            if isinstance(k, builtin_str):
                k = str(k)

            assert isinstance(k, str)
            if k in exclude:
                continue
            ret[k] = dict_filter(v, exclude)
        return ret

    return d
1344980
def unique(seq, preserve_order=True):
    
    if preserve_order:
        # f8 by Dave Kirby
        # Order preserving
        seen = set()
        seen_add = seen.add  # lookup method only once
        return [x for x in seq if x not in seen and not seen_add(x)]
    # f9
    # Not order preserving
    return list({}.fromkeys(seq).keys())
1246654
def items(cls):
        
        items = [(value.name, key) for key, value in cls.values.items()]
        return sorted(items, key=lambda x: x[1])
627783
def uniqueify(my_list: Any) -> List[Any]:
    """"""
    if sys.version_info >= (3, 6):
        # An implementation specific detail of py3.6 is the retention of order
        # within a dictionary. In py3.7 this becomes the documented behaviour.
        return list(dict.fromkeys(my_list))

    # Slower method of order preserving unique list in older python versions
    seen = set()
    return [x for x in my_list if x not in seen and not seen.add(x)]
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)
184775
def sorted(collection):
        
        if len(collection) < 1:
            return collection

        if isinstance(collection, dict):
            return sorted(collection.items(), key=lambda x: x[0])

        if isinstance(list(collection)[0], Operation):
            key = lambda x: x.operation_id
        elif isinstance(list(collection)[0], str):
            key = lambda x: SchemaObjects.get(x).name
        else:
            raise TypeError(type(collection[0]))
        return sorted(collection, key=key)
790695
def unique(iterable):
    
    """
    d = {}
    return (d.setdefault(x,x) for x in iterable if x not in d)
1133819
def unique(lst):
    
    nl = []
    [(nl.append(e) if type(e) is not list else nl.extend(e)) \
     for e in lst if e not in nl]
    return nl
125515
def unique (inlist):
    
    uniques = []
    for item in inlist:
        if item not in uniques:
            uniques.append(item)
    return uniques