a5f83e8f1e29c62070333d6ce48009e2fdb323b9,inferno/net.py,NeuralNet,initialize_callbacks,#NeuralNet#,192

Before Change


        names_and_cbs = self._get_callbacks_and_names(callbacks)

        names = list(zip(*names_and_cbs))[0]
        if len(names) != len(set(names)):
            // TODO: more useful message
            raise ValueError("There are callbacks with duplicate names.")

        callbacks_ = []
        for name, cb in names_and_cbs:
            params = self._get_params_for("callbacks__{}".format(name))
            cb.set_params(**params)

After Change


            if name in names_seen:
                raise ValueError("The callback name "{}" appears more than "
                                 "once.".format(name))
            names_seen.add(name)

            params = self._get_params_for("callbacks__{}".format(name))
            if isinstance(cb, type):  // uninitialized:
                cb = cb(**params)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: dnouri/skorch
Commit Name: a5f83e8f1e29c62070333d6ce48009e2fdb323b9
Time: 2017-07-19
Author: benjamin.bossan@ottogroup.com
File Name: inferno/net.py
Class Name: NeuralNet
Method Name: initialize_callbacks


Project Name: VOLTTRON/volttron
Commit Name: eecd204f1a5ba4de9752991e0fcbc86506309f1e
Time: 2019-12-09
Author: craig.allwardt@pnnl.gov
File Name: volttron/platform/agent/web.py
Class Name: Response
Method Name: add_header


Project Name: bokeh/bokeh
Commit Name: d9353e24bbe67e6c090cc0fd47ffb41b277b325d
Time: 2020-02-16
Author: mattpap@gmail.com
File Name: bokeh/io/webdriver.py
Class Name: _WebdriverState
Method Name: create