from field import field from unique import Unique from gen_random import gen_random goods = [{ 'title': 'Ковер', 'price': 2000, 'color': 'green' }, { 'title': 'Диван для отдыха', 'color': 'black' }] data = [ 1, 1, 11, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ] if __name__ == "__main__": print(list(gen_random(20, 1, 100))) print(list(field(goods, 'title'))) print(list(Unique(data)))
def f1(arg): return Unique(field(data, "job-name"), ignore_case=True)
def f1(arg): return sorted(list(Unique(field(arg, 'job-name'), ignore_case=True)), key=lambda x: str.casefold(x))
def f1(arg): return sorted(Unique([x for x in field(arg, "job-name")], ignore_case=True))
def f1(arg): return sorted(Unique([elem['job-name'] for elem in arg]))
def f1(arg): return sorted(list(Unique(field(arg, 'job-name'), ignore_case=True)))
def unique(forth): forth.stack.push(Unique())
def unique(self): _unique = Unique() _unique.set_working_directory(self._working_directory) return _unique