764b22136f964c50bcf7d30c4f1efe6bdaabd50b,src/BayesianModel/BayesianModel.py,BayesianModel,_get_ancestors_observation,#BayesianModel#,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
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

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: lovit/soynlp
Commit Name: bf03e74b9b0858f2e827e6da4b0ca8d960b3b5b6
Time: 2018-11-13
Author: soy.lovit@gmail.com
File Name: soynlp/pos/_news_pos.py
Class Name: NewsPOSExtractor
Method Name: _extract_compound_nouns


Project Name: nilmtk/nilmtk
Commit Name: 5eeca7d385178092790e08c1d5ad6cbcff35d3dc
Time: 2014-12-11
Author: jack-list@xlk.org.uk
File Name: nilmtk/metergroup.py
Class Name: MeterGroup
Method Name: load


Project Name: pgmpy/pgmpy
Commit Name: d9213be6d79011721e43444b03d27fe6aaa65071
Time: 2014-01-29
Author: abinash.panda.ece10@itbhu.ac.in
File Name: pgmpy/BayesianModel/BayesianModel.py
Class Name: BayesianModel
Method Name: active_trail_nodes