Did I find the right examples for you? yes no

All Samples(12)  |  Call(8)  |  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,'ACGU',-3) #negative
 
        f = keep_if_more('a',0) #zero
        self.assertEqual(f(''),0)
        self.assertEqual(f('a'),1)
        self.assertEqual(f('b'),0)
 
        # works on strings
        f = keep_if_more('ACGU',5) #positive
 
        # works on words
        f = keep_if_more(['foo'],1)
        self.assertEqual(f(''),0)
        self.assertEqual(f(['foo', 'bar','foo']),1)
        self.assertEqual(f(['joe']),0)
 
        # works on numbers
        f = keep_if_more([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,'ACGU',-3) #negative
 
        f = keep_if_more('a',0) #zero
        self.assertEqual(f(''),0)
        self.assertEqual(f('a'),1)
        self.assertEqual(f('b'),0)
 
        # works on strings
        f = keep_if_more('ACGU',5) #positive
 
        # works on words
        f = keep_if_more(['foo'],1)
        self.assertEqual(f(''),0)
        self.assertEqual(f(['foo', 'bar','foo']),1)
        self.assertEqual(f(['joe']),0)
 
        # works on numbers
        f = keep_if_more([0,1],3)

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

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