81ac05cfd756e6c43261660b5c6bfb44703ebe36,brian2/stateupdaters/base.py,StateUpdateMethod,determine_stateupdater,#Any#Any#Any#,111

Before Change


            raise ValueError(("No stateupdater that is suitable for the given "
                              "equations has been found"))

        name, stateupdater = best_stateupdater
        logger.info("Using stateupdater "%s"" % name)
        return stateupdater

After Change


            
            logger.info("Using manually specified state updater: %r" % method)
            return method
        elif isinstance(method, basestring):
            method = method.lower()  // normalize name to lower case
            stateupdater = StateUpdateMethod.stateupdaters.get(method, None)
            if stateupdater is None:
                raise ValueError("No state updater with the name "%s" "
                                 "is known" % method)
            if not stateupdater.can_integrate(equations, variables):
                raise ValueError(("The state updater "%s" cannot be used for "
                                  "the given equations" % method))
            return stateupdater
        elif isinstance(method, collections.Iterable):
            for name in method:
                if name not in StateUpdateMethod.stateupdaters:
                    logger.warn("No state updater with the name "%s" "
                                "is known" % name, "unkown_stateupdater")
                else:
                    stateupdater = StateUpdateMethod.stateupdaters[name]
                    try:
                        if stateupdater.can_integrate(equations, variables):
                            logger.info("Using stateupdater "%s"" % name)
                            return stateupdater
                    except KeyError:
                        logger.debug(("It could not be determined whether state "
                                      "updater "%s" is able to integrate the equations, "
                                      "it appears the namespace is not yet complete."
                                      % name))

            raise ValueError(("No stateupdater that is suitable for the given "
                              "equations has been found"))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: brian-team/brian2
Commit Name: 81ac05cfd756e6c43261660b5c6bfb44703ebe36
Time: 2015-03-02
Author: marcel.stimberg@inserm.fr
File Name: brian2/stateupdaters/base.py
Class Name: StateUpdateMethod
Method Name: determine_stateupdater


Project Name: Microsoft/nni
Commit Name: 10d7ece1c34c5533262a54d20d974a3d04f0b7ce
Time: 2020-09-15
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: src/sdk/pynni/nni/compression/tensorflow/compressor.py
Class Name:
Method Name: _instrument_model


Project Name: probcomp/bayeslite
Commit Name: 74dd9e13dd120056e8de90755cb13a433802e2e2
Time: 2017-07-19
Author: fsaad@mit.edu
File Name: src/metamodels/cgpm_metamodel.py
Class Name:
Method Name: _retrieve_analyze_variables