bf72974b7eb2229b6f4f4d7ae6b654693785d71f,brian2/core/magic.py,MagicNetwork,_update_magic_objects,#MagicNetwork#Any#,168

Before Change


    def _update_magic_objects(self, level):
        objects = collect(level+1)
        contained_objects = set()
        valid_refs = set()
        for obj in objects:
            if obj.invalidates_magic_network:
                valid_refs.add(weakref.ref(obj))
            for contained in _get_contained_objects(obj):
                contained_objects.add(contained)
        // check whether we should restart time, continue time, or raise an
        // error
        inter = valid_refs.intersection(self._previous_refs)
        if len(inter) == 0:
            // reset time
            self.t_ = 0.0
        elif len(self._previous_refs) == len(valid_refs):

After Change


            // reset id -- think of this as a new Network
            self.assign_id()

        for obj in objects:
            if obj._network is None:
                obj._network = self.id

        self.objects[:] = objects
        logger.info("Updated MagicNetwork to include {numobjs} objects "
                    "with names {names}".format(
                        numobjs=len(self.objects),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: brian-team/brian2
Commit Name: bf72974b7eb2229b6f4f4d7ae6b654693785d71f
Time: 2014-09-19
Author: marcel.stimberg@ens.fr
File Name: brian2/core/magic.py
Class Name: MagicNetwork
Method Name: _update_magic_objects


Project Name: pantsbuild/pants
Commit Name: efdb32a6d9a8aeea5f59100f1659583507f643b2
Time: 2014-11-10
Author: benjyw@gmail.com
File Name: src/python/pants/commands/goal_runner.py
Class Name: GoalRunner
Method Name: setup_parser


Project Name: MaybeShewill-CV/CRNN_Tensorflow
Commit Name: 196bc22bdcff8d6e5dc5e67cf50a5b8c09370002
Time: 2019-05-09
Author: yinjunqi@matrixtime.com
File Name: local_utils/evaluation_tools.py
Class Name:
Method Name: compute_accuracy