9c1978125348ab67190995586175a7d6402bf247,src/BayesianModel/BayesianModel.py,BayesianModel,__init__,#BayesianModel#Any#,31

Before Change


            for edge in ebunch:
                if not (isinstance(edge[0], str) and isinstance(edge[1], str)):
                    raise TypeError("Name of nodes must be strings")
                if edge[0] == edge[1]:
                    raise Exceptions.SelfLoopError("Self Loops are"
                                                   " not allowed", edge)

        nx.DiGraph.__init__(self, ebunch)

        if not ebunch is None:
            new_nodes = set(itertools.chain(*ebunch))

After Change


    
    def __init__(self, ebunch=None):
        if ebunch is not None:
            self._check_node_string(set(itertools.chain(*ebunch)))
            // for edge in ebunch:
            //     if not (isinstance(edge[0], str) and isinstance(edge[1], str)):
            //         raise TypeError("Name of nodes must be strings")
            //     if edge[0] == edge[1]:
            //         raise Exceptions.SelfLoopError("Self Loops are"
            //                                        " not allowed", edge)

        nx.DiGraph.__init__(self, ebunch)

        if ebunch is not None:
            new_nodes = set(itertools.chain(*ebunch))
            self._check_graph(delete_graph=True)
            self._update_node_parents(new_nodes)
            self._update_node_rule_for_parents(new_nodes)

    def add_node(self, node):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: pgmpy/pgmpy
Commit Name: 9c1978125348ab67190995586175a7d6402bf247
Time: 2013-12-31
Author: ankurankan@gmail.com
File Name: src/BayesianModel/BayesianModel.py
Class Name: BayesianModel
Method Name: __init__


Project Name: pgmpy/pgmpy
Commit Name: 9c1978125348ab67190995586175a7d6402bf247
Time: 2013-12-31
Author: ankurankan@gmail.com
File Name: src/BayesianModel/BayesianModel.py
Class Name: BayesianModel
Method Name: add_edges_from


Project Name: pgmpy/pgmpy
Commit Name: 9c1978125348ab67190995586175a7d6402bf247
Time: 2013-12-31
Author: ankurankan@gmail.com
File Name: src/BayesianModel/BayesianModel.py
Class Name: BayesianModel
Method Name: add_edge