bb0b34fe488fc125fcd8cbb367db92212ac988b3,brian2/stateupdaters/base.py,StateUpdateMethod,determine_stateupdater,#Any#Any#Any#Any#,90

Before Change


        priorities = [(name, updater.get_priority(equations,
                                              namespace,
                                              specifiers))
                         for name, updater in 
                         StateUpdateMethod.stateupdaters.iteritems()]
        priorities.sort(key=lambda elem: elem[1], reverse=True)

        // If the list is empty or the first (=best) priority is 0, we did not
        // find anything suitable
        if len(priorities) == 0 or priorities[0][1] == 0:
            raise ValueError(("No stateupdater that is suitable for the given "
                              "equations has been found"))

        // The first entry in the list is the stateupdater of our choice
        logger.info("Using stateupdater "%s"" % priorities[0][0])

        return StateUpdateMethod.stateupdaters[priorities[0][0]]

After Change


        
        if method is not None:
            stateupdater = None
            for name, registered_stateupdater in StateUpdateMethod.stateupdaters:
                if name == method:
                    stateupdater = registered_stateupdater
                    break
            if stateupdater is None:
                raise ValueError("No state updater with the name "%s" "
                                 "is known" % method)
            if not stateupdater.can_integrate(equations, namespace, specifiers):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: brian-team/brian2
Commit Name: bb0b34fe488fc125fcd8cbb367db92212ac988b3
Time: 2013-03-26
Author: marcel.stimberg@ens.fr
File Name: brian2/stateupdaters/base.py
Class Name: StateUpdateMethod
Method Name: determine_stateupdater


Project Name: deepchem/deepchem
Commit Name: 86328d567ff862262e0da70d0ebc9d90b407e03a
Time: 2017-11-29
Author: peastman@stanford.edu
File Name: deepchem/models/tensorgraph/tensor_graph.py
Class Name: TensorGraph
Method Name: predict_on_generator


Project Name: nilmtk/nilmtk
Commit Name: 63ef8bfa3b63090437bd27bf1e04db7ae1eae3cf
Time: 2014-11-27
Author: jack-list@xlk.org.uk
File Name: nilmtk/stats/totalenergy.py
Class Name:
Method Name: get_total_energy