d9213be6d79011721e43444b03d27fe6aaa65071,pgmpy/BayesianModel/BayesianModel.py,BayesianModel,active_trail_nodes,#BayesianModel#,770

Before Change


            _node, direction = visit_list.pop()
            if (_node, direction) not in traversed_list:
                if _node not in observed_list:
                    active_nodes += [_node]
                traversed_list += (_node, direction),
                if direction == "up" and _node not in observed_list:
                    for parent in self.predecessors(_node):
                        visit_list += (parent, "up"),
                    for child in self.successors(_node):
                        visit_list += (child, "down"),
                elif direction == "down":
                    if _node not in observed_list:
                        for child in self.successors(_node):
                            visit_list += (child, "down"),
                    if _node in ancestors_list:
                        for parent in self.predecessors(_node):
                            visit_list += (parent, "up"),
        active_nodes = list(set(active_nodes))
        return active_nodes

    def is_active_trail(self, start, end):
        Returns True if there is any active trail

After Change


        // up ->  from parent to child
        // down -> from child to parent

        visit_list = set()
        visit_list.add((start, "up"))
        traversed_list = set()
        active_nodes = set()
        while visit_list:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


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


Project Name: comic/grand-challenge.org
Commit Name: c7c47bbaf9c48c1919d3f7b928614d9f1300b7d3
Time: 2020-06-27
Author: 12661555+jmsmkn@users.noreply.github.com
File Name: app/grandchallenge/cases/image_builders/tiff.py
Class Name:
Method Name: image_builder_tiff


Project Name: andresriancho/w3af
Commit Name: 738966599b7e1eba13da06aa947797c01a54d26a
Time: 2018-07-19
Author: andres.riancho@gmail.com
File Name: w3af/plugins/grep/cross_domain_js.py
Class Name: cross_domain_js
Method Name: _load_secure_js_file


Project Name: gboeing/osmnx
Commit Name: d7b2db3c5262c82c44958afc2500efe0838f0884
Time: 2020-12-02
Author: boeing@usc.edu
File Name: osmnx/utils_graph.py
Class Name:
Method Name: _update_edge_keys