Did I find the right examples for you? yes no

All Samples(14)  |  Call(10)  |  Derive(0)  |  Import(4)

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, \
        self.assertRaises(IndexError,keep_if_more_other,'ACGU',-3) #negative
 
        f = keep_if_more_other('a',0) #zero
        self.assertEqual(f(''),0)
        self.assertEqual(f('a'),0)
        self.assertEqual(f('b'),1)
 
        # works on strings
        f = keep_if_more_other('ACGU',5) #positive
 
        # works on words
        f = keep_if_more_other(['foo'],1)
        self.assertEqual(f(''),0)
        self.assertEqual(f(['foo', 'bar','foo']),0)
        self.assertEqual(f(['joe','oef']),1)
 
        # works on numbers
        f = keep_if_more_other([0,1],3)

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, \
        self.assertRaises(IndexError,keep_if_more_other,'ACGU',-3) #negative
 
        f = keep_if_more_other('a',0) #zero
        self.assertEqual(f(''),0)
        self.assertEqual(f('a'),0)
        self.assertEqual(f('b'),1)
 
        # works on strings
        f = keep_if_more_other('ACGU',5) #positive
 
        # works on words
        f = keep_if_more_other(['foo'],1)
        self.assertEqual(f(''),0)
        self.assertEqual(f(['foo', 'bar','foo']),0)
        self.assertEqual(f(['joe','oef']),1)
 
        # works on numbers
        f = keep_if_more_other([0,1],3)

src/c/o/cogent-1.5.3/tests/test_util/test_organizer.py   cogent(Download)
 
from cogent.util.organizer import Filter, Organizer, GroupList, regroup
from cogent.util.transform import find_any, find_no, find_all,\
    keep_if_more, exclude_if_more, keep_if_more_other, exclude_if_more_other
from cogent.util.unit_test import TestCase,main
 
        f = find_all('abcd')
        g = keep_if_more_other('ab',7)
        fil = Filter('Archaea',{'Arch':[f,g]})
        assert fil['Arch'][0] is f

src/p/y/pycogent-HEAD/tests/test_util/test_organizer.py   pycogent(Download)
 
from cogent.util.organizer import Filter, Organizer, GroupList, regroup
from cogent.util.transform import find_any, find_no, find_all,\
    keep_if_more, exclude_if_more, keep_if_more_other, exclude_if_more_other
from cogent.util.unit_test import TestCase,main
 
        f = find_all('abcd')
        g = keep_if_more_other('ab',7)
        fil = Filter('Archaea',{'Arch':[f,g]})
        assert fil['Arch'][0] is f