37b54afef51c7430f8fa00db2f07e3532a7408da,dit/distribution.py,BaseDistribution,zipped,#BaseDistribution#Any#,661
Before Change
nonnull events only.
if null:
// Then we really want to iterate over the sample space.
//
// There are many ways to do this, but we need to do it in a way
// that does not rely on the particular implementation"s storage
// mechanism. Here is one way.
//
outcomes = list(self.sample_space())
zero = self.ops.zero
probs = [zero] * len(outcomes)
_outcomes = self.outcomes
_pmf = self.pmf
i, j = 0, 0
while j < len(_pmf):
if outcomes[i] == _outcomes[j]:
probs[i] = _pmf[j]
j += 1
i += 1
else:
outcomes = self.outcomes
probs = self.pmf
return izip(outcomes, probs)
After Change
raise ditException("Invalid mode.")
if mode == "pmf":
for x in izip(self.outcomes, self.pmf):
yield x
elif mode == "atoms":
// Then we want to iterate over the sample space.
//
// There are many ways to do this, but we need to do it in a way
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: dit/dit
Commit Name: 37b54afef51c7430f8fa00db2f07e3532a7408da
Time: 2013-10-01
Author: chebee7i@gmail.com
File Name: dit/distribution.py
Class Name: BaseDistribution
Method Name: zipped
Project Name: etal/cnvkit
Commit Name: 1edd1496383e7ae0374ec5dd8b455d58077e1d62
Time: 2016-10-30
Author: eric.talevich@gmail.com
File Name: cnvlib/_merge.py
Class Name:
Method Name: _merge_overlapping
Project Name: nilearn/nilearn
Commit Name: 5e3cd5a9f1dfc0e320d3ff5a384505bf06904365
Time: 2014-12-04
Author: loic.esteve@ymail.com
File Name: nilearn/plotting/displays.py
Class Name: BaseSlicer
Method Name: _map_show