811996fbd6b25acff19dc41e75e5fabe05f25c2c,pgmpy/readwrite/BIF.py,BifReader,__init__,#BifReader#Any#Any#,13

Before Change


        multi_space = OneOrMore(Literal(" ")|"\t"|"\r"|"\f")                                    // An expression for matching multi spaces

        if path:
            self.network = open(path, "r").read()                                               

        elif string:
            self.network = string        

After Change


        multi_space = OneOrMore(Literal(" ")|"\t"|"\r"|"\f")    // An pyparsing expression for checking mulitple spaces

        if path:
            with open(path, "r") as network:
                self.network = network.read()

        elif string:
            self.network = string

        else:
            raise ValueError("Must specify either path or string")

        if """ in self.network:
            
            Replacing quotes by spaces to remove case sensitivity like:
            "Dog-Problem" and Dog-problem
            or "true""false" and "true" "false" and true false
            
            self.network = self.network.replace(""", " ")

        self.network = multi_space.setParseAction(lambda t:" ").transformString(self.network)   // replacing mulitple spaces or tabs by one space

        if "/*" in self.network or "//" in self.network:
            self.network = cppStyleComment.suppress().transformString(self.network)             // removing comments from the file

        self.grammar = self.get_grammar(self.network)
        self.network_name = self.get_network_name()
        self.variable_names = self.get_variables()
        self.variable_states = self.get_states()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: pgmpy/pgmpy
Commit Name: 811996fbd6b25acff19dc41e75e5fabe05f25c2c
Time: 2015-11-12
Author: utkarsh.gupta550@gmail.com
File Name: pgmpy/readwrite/BIF.py
Class Name: BifReader
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 4cde148de0c37981c50f3a8e4a59fa4e5f653e17
Time: 2018-02-04
Author: bohumir.zamecnik@gmail.com
File Name: examples/lstm_text_generation.py
Class Name:
Method Name:


Project Name: brian-team/brian2
Commit Name: 137a37292e327cf304777b3fd9721dd772ad775e
Time: 2017-10-24
Author: teo@zifeo.com
File Name: dev/tools/static_codegen/units.py
Class Name:
Method Name: