Did I find the right examples for you? yes no

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_util/test_transform.py   cogent(Download)
from cogent.util.unit_test import TestCase, main
from cogent.util.misc import identity
from cogent.util.transform import apply_each, bools, bool_each, \
    conjoin, all, both,\
    disjoin, any, either, negate, none, neither, compose, compose_many, \
        duplicates = items * 3
 
        basic_indexer = index()
        i = basic_indexer(items)
        self.assertEqual(i, {num:[num], let:[let], zer:[zer], non:[non], y:[y]})
            non:[non]*3, y:[y]*3})
        #test with constructor
        str_indexer = index(str)
        i = str_indexer(items)
        self.assertEqual(i, {'5':[num,let], '0':[zer], 'None':[non], '3':[y]})
            'None':[non,non,non], '3':[y,y,y]})
        #test with squashing
        overwriter = index(str, overwrite=True)
        i = overwriter(duplicates)
        self.assertEqual(i, {'5':let, '0':zer, 'None':non, '3':y})

src/p/y/pycogent-HEAD/tests/test_util/test_transform.py   pycogent(Download)
from cogent.util.unit_test import TestCase, main
from cogent.util.misc import identity
from cogent.util.transform import apply_each, bools, bool_each, \
    conjoin, all, both,\
    disjoin, any, either, negate, none, neither, compose, compose_many, \
        duplicates = items * 3
 
        basic_indexer = index()
        i = basic_indexer(items)
        self.assertEqual(i, {num:[num], let:[let], zer:[zer], non:[non], y:[y]})
            non:[non]*3, y:[y]*3})
        #test with constructor
        str_indexer = index(str)
        i = str_indexer(items)
        self.assertEqual(i, {'5':[num,let], '0':[zer], 'None':[non], '3':[y]})
            'None':[non,non,non], '3':[y,y,y]})
        #test with squashing
        overwriter = index(str, overwrite=True)
        i = overwriter(duplicates)
        self.assertEqual(i, {'5':let, '0':zer, 'None':non, '3':y})