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_pick_from_prob_density(self):
        """Should take bin probabilitys and bin size and return random"""
        i = pick_from_prob_density([0,1.0,0,0],1)
        self.assertEqual(i,1)
 
        i = pick_from_prob_density([1.0,0,0,0],.01)

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_pick_from_prob_density(self):
        """Should take bin probabilitys and bin size and return random"""
        i = pick_from_prob_density([0,1.0,0,0],1)
        self.assertEqual(i,1)
 
        i = pick_from_prob_density([1.0,0,0,0],.01)