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

Before Change


            return stateupdater

        // determine the best suitable state updater
        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: 8

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: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 23a204d75f91c85bb542269447dbfa2164c695ce
Time: 2018-01-19
Author: max.lapan@gmail.com
File Name: ch13/wob_click_train.py
Class Name:
Method Name:


Project Name: calico/basenji
Commit Name: 4bd519216069fbfe70205adf9bfbc6bb48c4bcf5
Time: 2018-08-27
Author: drk@calicolabs.com
File Name: bin/basenji_train2.py
Class Name:
Method Name: make_data_ops