Example #1
0
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)))
Example #2
0
def f1(arg):
    return Unique(field(data, "job-name"), ignore_case=True)
Example #3
0
def f1(arg):
    return sorted(list(Unique(field(arg, 'job-name'), ignore_case=True)),
                  key=lambda x: str.casefold(x))
Example #4
0
def f1(arg):
    return sorted(Unique([x for x in field(arg, "job-name")], ignore_case=True))
Example #5
0
def f1(arg):
    return sorted(Unique([elem['job-name'] for elem in arg]))
Example #6
0
def f1(arg):
    return sorted(list(Unique(field(arg, 'job-name'), ignore_case=True)))
Example #7
0
def unique(forth):
    forth.stack.push(Unique())
Example #8
0
 def unique(self):
     _unique = Unique()
     _unique.set_working_directory(self._working_directory)
     return _unique