Did I find the right examples for you? yes no      Crawl my project      Python Jobs

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

src/c/o/cogent-1.5.3/tests/test_parse/test_flowgram_collection.py   cogent(Download)
from cogent.core.sequence import Sequence
 
from cogent.parse.flowgram_collection import FlowgramCollection, flows_from_array,\
     flows_from_generic,flows_from_kv_pairs,flows_from_empty,flows_from_dict,\
     flows_from_sff,assign_sequential_names,flows_from_flowCollection,\
    def test_flows_from_generic(self):
        """flows_from_flow should initialize from list of flowgram objects"""
        c = Flowgram('0.0 1.1 3.0 1.0', Name='a')
        b = Flowgram('0.5 1.0 4.0 0.0', Name = 'b')
        obs_a, obs_labels, obs_info = flows_from_generic([c,b])
 
        f = ['0.0 1.1 3.0 1.0','0.5 1.0 4.0 0.0']
        obs_a, obs_labels, obs_info = flows_from_generic(f)
        self.assertEqual(map(str,obs_a), ['0.0 1.1 3.0 1.0',
                                          '0.5 1.0 4.0 0.0'])

src/p/y/pycogent-HEAD/tests/test_parse/test_flowgram_collection.py   pycogent(Download)
from cogent.core.sequence import Sequence
 
from cogent.parse.flowgram_collection import FlowgramCollection, flows_from_array,\
     flows_from_generic,flows_from_kv_pairs,flows_from_empty,flows_from_dict,\
     flows_from_sff,assign_sequential_names,flows_from_flowCollection,\
    def test_flows_from_generic(self):
        """flows_from_flow should initialize from list of flowgram objects"""
        c = Flowgram('0.0 1.1 3.0 1.0', Name='a')
        b = Flowgram('0.5 1.0 4.0 0.0', Name = 'b')
        obs_a, obs_labels, obs_info = flows_from_generic([c,b])
 
        f = ['0.0 1.1 3.0 1.0','0.5 1.0 4.0 0.0']
        obs_a, obs_labels, obs_info = flows_from_generic(f)
        self.assertEqual(map(str,obs_a), ['0.0 1.1 3.0 1.0',
                                          '0.5 1.0 4.0 0.0'])