764b22136f964c50bcf7d30c4f1efe6bdaabd50b,src/BayesianModel/BayesianModel.py,BayesianModel,_get_ancestors_observation,#BayesianModel#Any#,736

Before Change


        Returns ancestors of all the observed elements
        obs_list = [obs for obs in observation]
        ancestors_list = []
        while obs_list:
            node = obs_list.pop()
            if node not in ancestors_list:
                obs_list += self.predecessors(node)
            ancestors_list += [node]
        return ancestors_list

    def _get_observed_list(self):
        

After Change


        
        Returns a list of all ancestors of all the observed nodes.
        
        ancestors_list = set()
        for node in observed_list:
            for predecessor in self.predecessors(node):
                ancestors_list.add(predecessor)
        return ancestors_list

    def _get_observed_list(self):
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pgmpy/pgmpy
Commit Name: 764b22136f964c50bcf7d30c4f1efe6bdaabd50b
Time: 2014-01-08
Author: ankurankan@gmail.com
File Name: src/BayesianModel/BayesianModel.py
Class Name: BayesianModel
Method Name: _get_ancestors_observation


Project Name: biocore/scikit-bio
Commit Name: daf661c3edd949f8ac2cd70e4a725d9a055cc0c3
Time: 2016-06-27
Author: mcdonadt@colorado.edu
File Name: skbio/tree/_tree.py
Class Name: TreeNode
Method Name: shear


Project Name: scipy/scipy
Commit Name: 589c372da5e415c4c0c33171971d3b26102b8b3c
Time: 2014-05-29
Author: perimosocordiae@gmail.com
File Name: scipy/sparse/construct.py
Class Name:
Method Name: rand