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_dict(self):
        """flows_from_dict should init from dictionary"""
        c = {'a':'0.0 1.1 3.0 1.0','b':'0.5 1.0 4.0 0.0'}
        obs_a, obs_labels, obs_info = flows_from_dict(c)
        self.assertEqual(map(str,obs_a), ['0.0 1.1 3.0 1.0','0.5 1.0 4.0 0.0'])
        self.assertEqual(obs_labels, ['a','b'])
        self.assertEqual(obs_info, [None,None])
 
        c ={'a':Flowgram('0.0 1.1 3.0 1.0'),'b':Flowgram('0.5 1.0 4.0 0.0')}
        obs_a, obs_labels, obs_info = flows_from_dict(c)

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_dict(self):
        """flows_from_dict should init from dictionary"""
        c = {'a':'0.0 1.1 3.0 1.0','b':'0.5 1.0 4.0 0.0'}
        obs_a, obs_labels, obs_info = flows_from_dict(c)
        self.assertEqual(map(str,obs_a), ['0.0 1.1 3.0 1.0','0.5 1.0 4.0 0.0'])
        self.assertEqual(obs_labels, ['a','b'])
        self.assertEqual(obs_info, [None,None])
 
        c ={'a':Flowgram('0.0 1.1 3.0 1.0'),'b':Flowgram('0.5 1.0 4.0 0.0')}
        obs_a, obs_labels, obs_info = flows_from_dict(c)