6e23720ba23b04e2cf8ae76dea5043ab25cbdc1d,brian2/core/variables.py,VariableView,__setitem__,#VariableView#Any#Any#,307

Before Change


        elif isinstance(value, basestring):
            indices = self.calc_indices(item)
            check_units = self.unit is not None
            template = self.group.templates.get("set_with_code",
                                                "group_variable_set")
            template = "group_variable_set"
            self.group._set_with_code(variable, indices, value,
                                      template=template,
                                      check_units=check_units,

After Change


                                                  template=template,
                                                  check_units=check_units,
                                                  level=self.level + 1)
        elif isinstance(item, basestring):
            try:
                value = float(value)
            except (TypeError, ValueError):
                raise TypeError("When setting a variable based on a string ",
                                "index, the value has to be a string or a "
                                "scalar.")
            check_units = self.unit is not None
            template = "group_variable_set_conditional"
            self.group._set_with_code_conditional(variable, item, repr(value),
                                                  template=template,
                                                  check_units=check_units,
                                                  level=self.level + 1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: brian-team/brian2
Commit Name: 6e23720ba23b04e2cf8ae76dea5043ab25cbdc1d
Time: 2013-10-08
Author: marcel.stimberg@ens.fr
File Name: brian2/core/variables.py
Class Name: VariableView
Method Name: __setitem__


Project Name: catalyst-team/catalyst
Commit Name: 81296e3b0a1508f0fa068668ba84c92f39cde431
Time: 2019-12-20
Author: tez.romach@gmail.com
File Name: catalyst/dl/experiment/config.py
Class Name: ConfigExperiment
Method Name: get_loaders