94bcd890a4d896511fe5b82c0099764ab7b78936,reframe/core/variables.py,VarSpace,extend,#VarSpace#Any#,69

Before Change


            // Override the required set
            if var.is_required():
                self._requiredVars.add(key)
            elif key in self._requiredVars:
                self._requiredVars.remove(key)

            self._attr[key] = var.types

    @property

After Change


            self._attr[key] = val

    def extend(self, cls):
        localVarSpace = getattr(cls, self.localAttrSpaceName)

        // Extend the var space
        for key, var in localVarSpace.items():

            // Disable redeclaring a variable
            if key in self._attr:
                raise ValueError(
                    f"cannot redeclare a variable ({key!r})"
                )

            self._attr[key] = var

        // Undefine the vars as indicated by the local var space
        for key in localVarSpace.undefined:
            self._check_var_is_declared(key)
            self._attr[key].undefine()

        // Define the vars as indicated by the local var space
        for key, val in localVarSpace.definitions.items():
            self._check_var_is_declared(key)
            self._attr[key].define(val)

    def _check_var_is_declared(self, key):
        if key not in self._attr:
            raise ValueError(
                f"var {key!r} has not been declared"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 5

Instances


Project Name: eth-cscs/reframe
Commit Name: 94bcd890a4d896511fe5b82c0099764ab7b78936
Time: 2021-01-18
Author: jotero@cscs.ch
File Name: reframe/core/variables.py
Class Name: VarSpace
Method Name: extend


Project Name: estnltk/estnltk
Commit Name: 731a81341c606564ae399f08b9dd07fb8766e000
Time: 2015-05-29
Author: tpetmanson@gmail.com
File Name: estnltk/text.py
Class Name: Text
Method Name: compute_analysis


Project Name: hyperspy/hyperspy
Commit Name: 4bc7c41914a31d157c7dcbb25fdef07ce0e69077
Time: 2020-09-02
Author: tjof2@cam.ac.uk
File Name: hyperspy/tests/io/test_empad.py
Class Name:
Method Name: teardown_module


Project Name: mil-tokyo/webdnn
Commit Name: 2571186c26968de784585bdabf0c0979e9608a85
Time: 2017-04-20
Author: y.kikura@gmail.com
File Name: src/graph_builder/optimizer/util.py
Class Name:
Method Name: listup_operator_in_order


Project Name: enthought/chaco
Commit Name: 8ccf40aa8b80f2c22289483eafa0166abf706360
Time: 2011-11-30
Author: pietro.berkes@googlemail.com
File Name: examples/tutorials/scipy2008/tool_chooser.py
Class Name: ToolChooserExample
Method Name: _tools_changed