{
    "file_diffs": [
        {
            "old_file_content": "from functools import partial\nfrom typing import Optional\n\nfrom AnyQt.QtWidgets import QWidget, QGridLayout\nfrom AnyQt.QtWidgets import QListView\nfrom AnyQt.QtCore import (\n    Qt, QTimer, QSortFilterProxyModel, QItemSelection, QItemSelectionModel,\n    QMimeData, QAbstractItemModel\n)\n\nfrom Orange.widgets import gui, widget\nfrom Orange.widgets.settings import (\n    ContextSetting, Setting, DomainContextHandler\n)\nfrom Orange.widgets.utils import vartype\nfrom Orange.widgets.utils.listfilter import (\n    VariablesListItemView, slices, variables_filter\n)\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.widget import Input, Output, AttributeList, Msg\nfrom Orange.data.table import Table\nfrom Orange.widgets.utils.itemmodels import VariableListModel\nimport Orange\n\n\ndef source_model(view):\n    \"\"\" Return the source model for the Qt Item View if it uses\n    the QSortFilterProxyModel.\n    \"\"\"\n    if isinstance(view.model(), QSortFilterProxyModel):\n        return view.model().sourceModel()\n    else:\n        return view.model()\n\n\ndef source_indexes(indexes, view):\n    \"\"\" Map model indexes through a views QSortFilterProxyModel\n    \"\"\"\n    model = view.model()\n    if isinstance(model, QSortFilterProxyModel):\n        return list(map(model.mapToSource, indexes))\n    else:\n        return indexes\n\n\nclass VariablesListItemModel(VariableListModel):\n    \"\"\"\n    An Variable list item model specialized for Drag and Drop.\n    \"\"\"\n    MIME_TYPE = \"application/x-Orange-VariableListModelData\"\n\n    def flags(self, index):\n        flags = super().flags(index)\n        if index.isValid():\n            flags |= Qt.ItemIsDragEnabled\n        else:\n            flags |= Qt.ItemIsDropEnabled\n        return flags\n\n    @staticmethod\n    def supportedDropActions():\n        return Qt.MoveAction  # pragma: no cover\n\n    @staticmethod\n    def supportedDragActions():\n        return Qt.MoveAction  # pragma: no cover\n\n    def mimeTypes(self):\n        return [self.MIME_TYPE]\n\n    def mimeData(self, indexlist):\n        \"\"\"\n        Reimplemented.\n\n        For efficiency reasons only the variable instances are set on the\n        mime data (under `'_items'` property)\n        \"\"\"\n        items = [self[index.row()] for index in indexlist]\n        mime = QMimeData()\n        # the encoded 'data' is empty, variables are passed by properties\n        mime.setData(self.MIME_TYPE, b'')\n        mime.setProperty(\"_items\", items)\n        return mime\n\n    def dropMimeData(self, mime, action, row, column, parent):\n        \"\"\"\n        Reimplemented.\n        \"\"\"\n        if action == Qt.IgnoreAction:\n            return True  # pragma: no cover\n        if not mime.hasFormat(self.MIME_TYPE):\n            return False  # pragma: no cover\n        variables = mime.property(\"_items\")\n        if variables is None:\n            return False  # pragma: no cover\n        if row < 0:\n            row = self.rowCount()\n\n        self[row:row] = variables\n        return True\n\n\nclass SelectAttributesDomainContextHandler(DomainContextHandler):\n    def encode_setting(self, context, setting, value):\n        if setting.name == 'domain_role_hints':\n            value = {(var.name, vartype(var)): role_i\n                     for var, role_i in value.items()}\n        return super().encode_setting(context, setting, value)\n\n    def decode_setting(self, setting, value, domain=None, *_args):\n        decoded = super().decode_setting(setting, value, domain)\n        if setting.name == 'domain_role_hints':\n            decoded = {domain[name]: role_i\n                       for (name, _), role_i in decoded.items()}\n        return decoded\n\n    def match(self, context, domain, attrs, metas):\n        if not \"domain_role_hints\" in context.values:\n            return self.NO_MATCH\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = context.values[\"domain_role_hints\"][0]\n        assigned = [desc for desc, (role, _) in value.items()\n                    if role != \"available\"]\n        if not assigned:\n            return self.NO_MATCH\n        return sum(all_vars.get(attr) == vtype for attr, vtype in assigned) \\\n               / len(assigned)\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        if setting.name != \"domain_role_hints\":\n            return super().filter_value(setting, data, domain, attrs, metas)\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = data[\"domain_role_hints\"][0].items()\n        data[\"domain_role_hints\"] = {desc: role_i\n                                     for desc, role_i in value\n                                     if all_vars.get(desc[0]) == desc[1]}\n\n\nclass OWSelectAttributes(widget.OWWidget):\n    # pylint: disable=too-many-instance-attributes\n    name = \"Select Columns\"\n    description = \"Select columns from the data table and assign them to \" \\\n                  \"data features, classes or meta variables.\"\n    icon = \"icons/SelectColumns.svg\"\n    priority = 100\n    keywords = [\"filter\", \"attributes\", \"target\", \"variable\"]\n\n    class Inputs:\n        data = Input(\"Data\", Table, default=True)\n        features = Input(\"Features\", AttributeList)\n\n    class Outputs:\n        data = Output(\"Data\", Table)\n        features = Output(\"Features\", AttributeList, dynamic=False)\n\n    want_main_area = False\n    want_control_area = True\n\n    settingsHandler = SelectAttributesDomainContextHandler(first_match=False)\n    domain_role_hints = ContextSetting({})\n    use_input_features = Setting(False)\n    auto_commit = Setting(True)\n\n    class Warning(widget.OWWidget.Warning):\n        mismatching_domain = Msg(\"Features and data domain do not match\")\n\n    def __init__(self):\n        super().__init__()\n        self.data = None\n        self.features = None\n\n        # Schedule interface updates (enabled buttons) using a coalescing\n        # single shot timer (complex interactions on selection and filtering\n        # updates in the 'available_attrs_view')\n        self.__interface_update_timer = QTimer(self, interval=0, singleShot=True)\n        self.__interface_update_timer.timeout.connect(\n            self.__update_interface_state)\n        # The last view that has the selection for move operation's source\n        self.__last_active_view = None  # type: Optional[QListView]\n\n        def update_on_change(view):\n            # Schedule interface state update on selection change in `view`\n            self.__last_active_view = view\n            self.__interface_update_timer.start()\n\n        self.controlArea = QWidget(self.controlArea)\n        self.layout().addWidget(self.controlArea)\n        layout = QGridLayout()\n        self.controlArea.setLayout(layout)\n        layout.setContentsMargins(4, 4, 4, 4)\n        box = gui.vBox(self.controlArea, \"Available Variables\",\n                       addToLayout=False)\n\n        self.available_attrs = VariablesListItemModel()\n        filter_edit, self.available_attrs_view = variables_filter(\n            parent=self, model=self.available_attrs)\n        box.layout().addWidget(filter_edit)\n\n        def dropcompleted(action):\n            if action == Qt.MoveAction:\n                self.commit()\n\n        self.available_attrs_view.selectionModel().selectionChanged.connect(\n            partial(update_on_change, self.available_attrs_view))\n        self.available_attrs_view.dragDropActionDidComplete.connect(dropcompleted)\n\n        box.layout().addWidget(self.available_attrs_view)\n        layout.addWidget(box, 0, 0, 3, 1)\n\n        box = gui.vBox(self.controlArea, \"Features\", addToLayout=False)\n        self.used_attrs = VariablesListItemModel()\n        filter_edit, self.used_attrs_view = variables_filter(\n            parent=self, model=self.used_attrs,\n            accepted_type=(Orange.data.DiscreteVariable,\n                           Orange.data.ContinuousVariable))\n        self.used_attrs.rowsInserted.connect(self.__used_attrs_changed)\n        self.used_attrs.rowsRemoved.connect(self.__used_attrs_changed)\n        self.used_attrs_view.selectionModel().selectionChanged.connect(\n            partial(update_on_change, self.used_attrs_view))\n        self.used_attrs_view.dragDropActionDidComplete.connect(dropcompleted)\n        self.use_features_box = gui.auto_commit(\n            self.controlArea, self, \"use_input_features\",\n            \"Use input features\", \"Always use input features\",\n            box=False, commit=self.__use_features_clicked,\n            callback=self.__use_features_changed, addToLayout=False\n        )\n        self.enable_use_features_box()\n        box.layout().addWidget(self.use_features_box)\n        box.layout().addWidget(filter_edit)\n        box.layout().addWidget(self.used_attrs_view)\n        layout.addWidget(box, 0, 2, 1, 1)\n\n        box = gui.vBox(self.controlArea, \"Target Variable\", addToLayout=False)\n        self.class_attrs = VariablesListItemModel()\n        self.class_attrs_view = VariablesListItemView(\n            acceptedType=(Orange.data.DiscreteVariable,\n                          Orange.data.ContinuousVariable))\n        self.class_attrs_view.setModel(self.class_attrs)\n        self.class_attrs_view.selectionModel().selectionChanged.connect(\n            partial(update_on_change, self.class_attrs_view))\n        self.class_attrs_view.dragDropActionDidComplete.connect(dropcompleted)\n        self.class_attrs_view.setMaximumHeight(72)\n        box.layout().addWidget(self.class_attrs_view)\n        layout.addWidget(box, 1, 2, 1, 1)\n\n        box = gui.vBox(self.controlArea, \"Meta Attributes\", addToLayout=False)\n        self.meta_attrs = VariablesListItemModel()\n        self.meta_attrs_view = VariablesListItemView(\n            acceptedType=Orange.data.Variable)\n        self.meta_attrs_view.setModel(self.meta_attrs)\n        self.meta_attrs_view.selectionModel().selectionChanged.connect(\n            partial(update_on_change, self.meta_attrs_view))\n        self.meta_attrs_view.dragDropActionDidComplete.connect(dropcompleted)\n        box.layout().addWidget(self.meta_attrs_view)\n        layout.addWidget(box, 2, 2, 1, 1)\n\n        bbox = gui.vBox(self.controlArea, addToLayout=False, margin=0)\n        layout.addWidget(bbox, 0, 1, 1, 1)\n\n        self.up_attr_button = gui.button(bbox, self, \"Up\",\n                                         callback=partial(self.move_up, self.used_attrs_view))\n        self.move_attr_button = gui.button(bbox, self, \">\",\n                                           callback=partial(self.move_selected,\n                                                            self.used_attrs_view)\n                                          )\n        self.down_attr_button = gui.button(bbox, self, \"Down\",\n                                           callback=partial(self.move_down, self.used_attrs_view))\n\n        bbox = gui.vBox(self.controlArea, addToLayout=False, margin=0)\n        layout.addWidget(bbox, 1, 1, 1, 1)\n\n        self.up_class_button = gui.button(bbox, self, \"Up\",\n                                          callback=partial(self.move_up, self.class_attrs_view))\n        self.move_class_button = gui.button(bbox, self, \">\",\n                                            callback=partial(self.move_selected,\n                                                             self.class_attrs_view)\n                                           )\n        self.down_class_button = gui.button(bbox, self, \"Down\",\n                                            callback=partial(self.move_down, self.class_attrs_view))\n\n        bbox = gui.vBox(self.controlArea, addToLayout=False, margin=0)\n        layout.addWidget(bbox, 2, 1, 1, 1)\n        self.up_meta_button = gui.button(bbox, self, \"Up\",\n                                         callback=partial(self.move_up, self.meta_attrs_view))\n        self.move_meta_button = gui.button(bbox, self, \">\",\n                                           callback=partial(self.move_selected,\n                                                            self.meta_attrs_view)\n                                          )\n        self.down_meta_button = gui.button(bbox, self, \"Down\",\n                                           callback=partial(self.move_down, self.meta_attrs_view))\n\n        autobox = gui.auto_send(None, self, \"auto_commit\")\n        layout.addWidget(autobox, 3, 0, 1, 3)\n        reset = gui.button(None, self, \"Reset\", callback=self.reset, width=120)\n        autobox.layout().insertWidget(0, reset)\n        autobox.layout().insertStretch(1, 20)\n\n        layout.setRowStretch(0, 4)\n        layout.setRowStretch(1, 0)\n        layout.setRowStretch(2, 2)\n        layout.setHorizontalSpacing(0)\n        self.controlArea.setLayout(layout)\n\n        self.output_data = None\n        self.original_completer_items = []\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n        self.resize(600, 600)\n\n    @property\n    def features_from_data_attributes(self):\n        if self.data is None or self.features is None:\n            return []\n        domain = self.data.domain\n        return [domain[feature.name] for feature in self.features\n                if feature.name in domain and domain[feature.name]\n                in domain.attributes]\n\n    def can_use_features(self):\n        return bool(self.features_from_data_attributes) and \\\n               self.features_from_data_attributes != self.used_attrs[:]\n\n    def __use_features_changed(self):  # Use input features check box\n        # Needs a check since callback is invoked before object is created\n        if not hasattr(self, \"use_features_box\"):\n            return\n        self.enable_used_attrs(not self.use_input_features)\n        if self.use_input_features and self.can_use_features():\n            self.use_features()\n        if not self.use_input_features:\n            self.enable_use_features_box()\n\n    def __use_features_clicked(self):  # Use input features button\n        self.use_features()\n\n    def __used_attrs_changed(self):\n        self.enable_use_features_box()\n\n    @Inputs.data\n    def set_data(self, data=None):\n        self.update_domain_role_hints()\n        self.closeContext()\n        self.domain_role_hints = {}\n\n        self.data = data\n        if data is None:\n            self.used_attrs[:] = []\n            self.class_attrs[:] = []\n            self.meta_attrs[:] = []\n            self.available_attrs[:] = []\n            self.info.set_input_summary(self.info.NoInput)\n            return\n\n        self.openContext(data)\n        all_vars = data.domain.variables + data.domain.metas\n\n        def attrs_for_role(role):\n            selected_attrs = [\n                attr for attr in all_vars if domain_hints[attr][0] == role\n            ]\n            return sorted(selected_attrs, key=lambda attr: domain_hints[attr][1])\n\n        domain = data.domain\n        domain_hints = {}\n        domain_hints.update(self._hints_from_seq(\"attribute\", domain.attributes))\n        domain_hints.update(self._hints_from_seq(\"meta\", domain.metas))\n        domain_hints.update(self._hints_from_seq(\"class\", domain.class_vars))\n        domain_hints.update(self.domain_role_hints)\n\n        self.used_attrs[:] = attrs_for_role(\"attribute\")\n        self.class_attrs[:] = attrs_for_role(\"class\")\n        self.meta_attrs[:] = attrs_for_role(\"meta\")\n        self.available_attrs[:] = attrs_for_role(\"available\")\n        self.info.set_input_summary(len(data), format_summary_details(data))\n\n    def update_domain_role_hints(self):\n        \"\"\" Update the domain hints to be stored in the widgets settings.\n        \"\"\"\n        hints = {}\n        hints.update(self._hints_from_seq(\"available\", self.available_attrs))\n        hints.update(self._hints_from_seq(\"attribute\", self.used_attrs))\n        hints.update(self._hints_from_seq(\"class\", self.class_attrs))\n        hints.update(self._hints_from_seq(\"meta\", self.meta_attrs))\n        self.domain_role_hints = hints\n\n    @staticmethod\n    def _hints_from_seq(role, model):\n        return [(attr, (role, i)) for i, attr in enumerate(model)]\n\n    @Inputs.features\n    def set_features(self, features):\n        self.features = features\n\n    def handleNewSignals(self):\n        self.check_data()\n        self.enable_used_attrs()\n        self.enable_use_features_box()\n        if self.use_input_features and self.features_from_data_attributes:\n            self.enable_used_attrs(False)\n            self.use_features()\n        self.unconditional_commit()\n\n    def check_data(self):\n        self.Warning.mismatching_domain.clear()\n        if self.data is not None and self.features is not None and \\\n                not self.features_from_data_attributes:\n            self.Warning.mismatching_domain()\n\n    def enable_used_attrs(self, enable=True):\n        self.up_attr_button.setEnabled(enable)\n        self.move_attr_button.setEnabled(enable)\n        self.down_attr_button.setEnabled(enable)\n        self.used_attrs_view.setEnabled(enable)\n        self.used_attrs_view.repaint()\n\n    def enable_use_features_box(self):\n        self.use_features_box.button.setEnabled(self.can_use_features())\n        enable_checkbox = bool(self.features_from_data_attributes)\n        self.use_features_box.setHidden(not enable_checkbox)\n        self.use_features_box.repaint()\n\n    def use_features(self):\n        attributes = self.features_from_data_attributes\n        available, used = self.available_attrs[:], self.used_attrs[:]\n        self.available_attrs[:] = [attr for attr in used + available\n                                   if attr not in attributes]\n        self.used_attrs[:] = attributes\n        self.commit()\n\n    @staticmethod\n    def selected_rows(view):\n        \"\"\" Return the selected rows in the view.\n        \"\"\"\n        rows = view.selectionModel().selectedRows()\n        model = view.model()\n        if isinstance(model, QSortFilterProxyModel):\n            rows = [model.mapToSource(r) for r in rows]\n        return [r.row() for r in rows]\n\n    def move_rows(self, view: QListView, offset: int, roles=(Qt.EditRole,)):\n        rows = [idx.row() for idx in view.selectionModel().selectedRows()]\n        model = view.model()  # type: QAbstractItemModel\n        rowcount = model.rowCount()\n        newrows = [min(max(0, row + offset), rowcount - 1) for row in rows]\n\n        def itemData(index):\n            return {role: model.data(index, role) for role in roles}\n\n        for row, newrow in sorted(zip(rows, newrows), reverse=offset > 0):\n            d1 = itemData(model.index(row, 0))\n            d2 = itemData(model.index(newrow, 0))\n            model.setItemData(model.index(row, 0), d2)\n            model.setItemData(model.index(newrow, 0), d1)\n\n        selection = QItemSelection()\n        for nrow in newrows:\n            index = model.index(nrow, 0)\n            selection.select(index, index)\n        view.selectionModel().select(\n            selection, QItemSelectionModel.ClearAndSelect)\n\n        self.commit()\n\n    def move_up(self, view: QListView):\n        self.move_rows(view, -1)\n\n    def move_down(self, view: QListView):\n        self.move_rows(view, 1)\n\n    def move_selected(self, view):\n        if self.selected_rows(view):\n            self.move_selected_from_to(view, self.available_attrs_view)\n        elif self.selected_rows(self.available_attrs_view):\n            self.move_selected_from_to(self.available_attrs_view, view)\n\n    def move_selected_from_to(self, src, dst):\n        self.move_from_to(src, dst, self.selected_rows(src))\n\n    def move_from_to(self, src, dst, rows):\n        src_model = source_model(src)\n        attrs = [src_model[r] for r in rows]\n\n        for s1, s2 in reversed(list(slices(rows))):\n            del src_model[s1:s2]\n\n        dst_model = source_model(dst)\n\n        dst_model.extend(attrs)\n\n        self.commit()\n\n    def __update_interface_state(self):\n        last_view = self.__last_active_view\n        if last_view is not None:\n            self.update_interface_state(last_view)\n\n    def update_interface_state(self, focus=None):\n        for view in [self.available_attrs_view, self.used_attrs_view,\n                     self.class_attrs_view, self.meta_attrs_view]:\n            if view is not focus and not view.hasFocus() \\\n                    and view.selectionModel().hasSelection():\n                view.selectionModel().clear()\n\n        def selected_vars(view):\n            model = source_model(view)\n            return [model[i] for i in self.selected_rows(view)]\n\n        available_selected = selected_vars(self.available_attrs_view)\n        attrs_selected = selected_vars(self.used_attrs_view)\n        class_selected = selected_vars(self.class_attrs_view)\n        meta_selected = selected_vars(self.meta_attrs_view)\n\n        available_types = set(map(type, available_selected))\n        all_primitive = all(var.is_primitive()\n                            for var in available_types)\n\n        move_attr_enabled = \\\n            ((available_selected and all_primitive) or attrs_selected) and \\\n            self.used_attrs_view.isEnabled()\n\n        self.move_attr_button.setEnabled(bool(move_attr_enabled))\n        if move_attr_enabled:\n            self.move_attr_button.setText(\">\" if available_selected else \"<\")\n\n        move_class_enabled = bool(all_primitive and available_selected) or class_selected\n\n        self.move_class_button.setEnabled(bool(move_class_enabled))\n        if move_class_enabled:\n            self.move_class_button.setText(\">\" if available_selected else \"<\")\n        move_meta_enabled = available_selected or meta_selected\n\n        self.move_meta_button.setEnabled(bool(move_meta_enabled))\n        if move_meta_enabled:\n            self.move_meta_button.setText(\">\" if available_selected else \"<\")\n\n        self.__last_active_view = None\n        self.__interface_update_timer.stop()\n\n    def commit(self):\n        self.update_domain_role_hints()\n        if self.data is not None:\n            attributes = list(self.used_attrs)\n            class_var = list(self.class_attrs)\n            metas = list(self.meta_attrs)\n\n            domain = Orange.data.Domain(attributes, class_var, metas)\n            newdata = self.data.transform(domain)\n            self.output_data = newdata\n            self.Outputs.data.send(newdata)\n            self.Outputs.features.send(AttributeList(attributes))\n            self.info.set_output_summary(len(newdata),\n                                         format_summary_details(newdata))\n        else:\n            self.output_data = None\n            self.Outputs.data.send(None)\n            self.Outputs.features.send(None)\n            self.info.set_output_summary(self.info.NoOutput)\n\n    def reset(self):\n        self.enable_used_attrs()\n        self.use_features_box.checkbox.setChecked(False)\n        if self.data is not None:\n            self.available_attrs[:] = []\n            self.used_attrs[:] = self.data.domain.attributes\n            self.class_attrs[:] = self.data.domain.class_vars\n            self.meta_attrs[:] = self.data.domain.metas\n            self.update_domain_role_hints()\n            self.commit()\n\n    def send_report(self):\n        if not self.data or not self.output_data:\n            return\n        in_domain, out_domain = self.data.domain, self.output_data.domain\n        self.report_domain(\"Input data\", self.data.domain)\n        if (in_domain.attributes, in_domain.class_vars, in_domain.metas) == (\n                out_domain.attributes, out_domain.class_vars, out_domain.metas):\n            self.report_paragraph(\"Output data\", \"No changes.\")\n        else:\n            self.report_domain(\"Output data\", self.output_data.domain)\n            diff = list(set(in_domain.variables + in_domain.metas) -\n                        set(out_domain.variables + out_domain.metas))\n            if diff:\n                text = \"%i (%s)\" % (len(diff), \", \".join(x.name for x in diff))\n                self.report_items(((\"Removed\", text),))\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    brown = Orange.data.Table(\"brown-selected\")\n    feats = AttributeList(brown.domain.attributes[:2])\n    WidgetPreview(OWSelectAttributes).run(set_data=brown, set_features=feats)\n",
            "new_file_content": "from functools import partial\nfrom typing import Optional\n\nfrom AnyQt.QtWidgets import QWidget, QGridLayout\nfrom AnyQt.QtWidgets import QListView\nfrom AnyQt.QtCore import (\n    Qt, QTimer, QSortFilterProxyModel, QItemSelection, QItemSelectionModel,\n    QMimeData, QAbstractItemModel\n)\n\nfrom Orange.widgets import gui, widget\nfrom Orange.widgets.settings import (\n    ContextSetting, Setting, DomainContextHandler\n)\nfrom Orange.widgets.utils import vartype\nfrom Orange.widgets.utils.listfilter import (\n    VariablesListItemView, slices, variables_filter\n)\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.utils.state_summary import format_summary_details\nfrom Orange.widgets.widget import Input, Output, AttributeList, Msg\nfrom Orange.data.table import Table\nfrom Orange.widgets.utils.itemmodels import VariableListModel\nimport Orange\n\n\ndef source_model(view):\n    \"\"\" Return the source model for the Qt Item View if it uses\n    the QSortFilterProxyModel.\n    \"\"\"\n    if isinstance(view.model(), QSortFilterProxyModel):\n        return view.model().sourceModel()\n    else:\n        return view.model()\n\n\ndef source_indexes(indexes, view):\n    \"\"\" Map model indexes through a views QSortFilterProxyModel\n    \"\"\"\n    model = view.model()\n    if isinstance(model, QSortFilterProxyModel):\n        return list(map(model.mapToSource, indexes))\n    else:\n        return indexes\n\n\nclass VariablesListItemModel(VariableListModel):\n    \"\"\"\n    An Variable list item model specialized for Drag and Drop.\n    \"\"\"\n    MIME_TYPE = \"application/x-Orange-VariableListModelData\"\n\n    def flags(self, index):\n        flags = super().flags(index)\n        if index.isValid():\n            flags |= Qt.ItemIsDragEnabled\n        else:\n            flags |= Qt.ItemIsDropEnabled\n        return flags\n\n    @staticmethod\n    def supportedDropActions():\n        return Qt.MoveAction  # pragma: no cover\n\n    @staticmethod\n    def supportedDragActions():\n        return Qt.MoveAction  # pragma: no cover\n\n    def mimeTypes(self):\n        return [self.MIME_TYPE]\n\n    def mimeData(self, indexlist):\n        \"\"\"\n        Reimplemented.\n\n        For efficiency reasons only the variable instances are set on the\n        mime data (under `'_items'` property)\n        \"\"\"\n        items = [self[index.row()] for index in indexlist]\n        mime = QMimeData()\n        # the encoded 'data' is empty, variables are passed by properties\n        mime.setData(self.MIME_TYPE, b'')\n        mime.setProperty(\"_items\", items)\n        return mime\n\n    def dropMimeData(self, mime, action, row, column, parent):\n        \"\"\"\n        Reimplemented.\n        \"\"\"\n        if action == Qt.IgnoreAction:\n            return True  # pragma: no cover\n        if not mime.hasFormat(self.MIME_TYPE):\n            return False  # pragma: no cover\n        variables = mime.property(\"_items\")\n        if variables is None:\n            return False  # pragma: no cover\n        if row < 0:\n            row = self.rowCount()\n\n        self[row:row] = variables\n        return True\n\n\nclass SelectAttributesDomainContextHandler(DomainContextHandler):\n    def encode_setting(self, context, setting, value):\n        if setting.name == 'domain_role_hints':\n            value = {(var.name, vartype(var)): role_i\n                     for var, role_i in value.items()}\n        return super().encode_setting(context, setting, value)\n\n    def decode_setting(self, setting, value, domain=None, *_args):\n        decoded = super().decode_setting(setting, value, domain)\n        if setting.name == 'domain_role_hints':\n            decoded = {domain[name]: role_i\n                       for (name, _), role_i in decoded.items()}\n        return decoded\n\n    def match(self, context, domain, attrs, metas):\n        if context.attributes == attrs and context.metas == metas:\n            return self.PERFECT_MATCH\n\n        if not \"domain_role_hints\" in context.values:\n            return self.NO_MATCH\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = context.values[\"domain_role_hints\"][0]\n        assigned = [desc for desc, (role, _) in value.items()\n                    if role != \"available\"]\n        if not assigned:\n            return self.NO_MATCH\n        return sum(all_vars.get(attr) == vtype for attr, vtype in assigned) \\\n               / len(assigned)\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        if setting.name != \"domain_role_hints\":\n            return super().filter_value(setting, data, domain, attrs, metas)\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = data[\"domain_role_hints\"][0].items()\n        data[\"domain_role_hints\"] = {desc: role_i\n                                     for desc, role_i in value\n                                     if all_vars.get(desc[0]) == desc[1]}\n\n\nclass OWSelectAttributes(widget.OWWidget):\n    # pylint: disable=too-many-instance-attributes\n    name = \"Select Columns\"\n    description = \"Select columns from the data table and assign them to \" \\\n                  \"data features, classes or meta variables.\"\n    icon = \"icons/SelectColumns.svg\"\n    priority = 100\n    keywords = [\"filter\", \"attributes\", \"target\", \"variable\"]\n\n    class Inputs:\n        data = Input(\"Data\", Table, default=True)\n        features = Input(\"Features\", AttributeList)\n\n    class Outputs:\n        data = Output(\"Data\", Table)\n        features = Output(\"Features\", AttributeList, dynamic=False)\n\n    want_main_area = False\n    want_control_area = True\n\n    settingsHandler = SelectAttributesDomainContextHandler(first_match=False)\n    domain_role_hints = ContextSetting({})\n    use_input_features = Setting(False)\n    auto_commit = Setting(True)\n\n    class Warning(widget.OWWidget.Warning):\n        mismatching_domain = Msg(\"Features and data domain do not match\")\n\n    def __init__(self):\n        super().__init__()\n        self.data = None\n        self.features = None\n\n        # Schedule interface updates (enabled buttons) using a coalescing\n        # single shot timer (complex interactions on selection and filtering\n        # updates in the 'available_attrs_view')\n        self.__interface_update_timer = QTimer(self, interval=0, singleShot=True)\n        self.__interface_update_timer.timeout.connect(\n            self.__update_interface_state)\n        # The last view that has the selection for move operation's source\n        self.__last_active_view = None  # type: Optional[QListView]\n\n        def update_on_change(view):\n            # Schedule interface state update on selection change in `view`\n            self.__last_active_view = view\n            self.__interface_update_timer.start()\n\n        self.controlArea = QWidget(self.controlArea)\n        self.layout().addWidget(self.controlArea)\n        layout = QGridLayout()\n        self.controlArea.setLayout(layout)\n        layout.setContentsMargins(4, 4, 4, 4)\n        box = gui.vBox(self.controlArea, \"Available Variables\",\n                       addToLayout=False)\n\n        self.available_attrs = VariablesListItemModel()\n        filter_edit, self.available_attrs_view = variables_filter(\n            parent=self, model=self.available_attrs)\n        box.layout().addWidget(filter_edit)\n\n        def dropcompleted(action):\n            if action == Qt.MoveAction:\n                self.commit()\n\n        self.available_attrs_view.selectionModel().selectionChanged.connect(\n            partial(update_on_change, self.available_attrs_view))\n        self.available_attrs_view.dragDropActionDidComplete.connect(dropcompleted)\n\n        box.layout().addWidget(self.available_attrs_view)\n        layout.addWidget(box, 0, 0, 3, 1)\n\n        box = gui.vBox(self.controlArea, \"Features\", addToLayout=False)\n        self.used_attrs = VariablesListItemModel()\n        filter_edit, self.used_attrs_view = variables_filter(\n            parent=self, model=self.used_attrs,\n            accepted_type=(Orange.data.DiscreteVariable,\n                           Orange.data.ContinuousVariable))\n        self.used_attrs.rowsInserted.connect(self.__used_attrs_changed)\n        self.used_attrs.rowsRemoved.connect(self.__used_attrs_changed)\n        self.used_attrs_view.selectionModel().selectionChanged.connect(\n            partial(update_on_change, self.used_attrs_view))\n        self.used_attrs_view.dragDropActionDidComplete.connect(dropcompleted)\n        self.use_features_box = gui.auto_commit(\n            self.controlArea, self, \"use_input_features\",\n            \"Use input features\", \"Always use input features\",\n            box=False, commit=self.__use_features_clicked,\n            callback=self.__use_features_changed, addToLayout=False\n        )\n        self.enable_use_features_box()\n        box.layout().addWidget(self.use_features_box)\n        box.layout().addWidget(filter_edit)\n        box.layout().addWidget(self.used_attrs_view)\n        layout.addWidget(box, 0, 2, 1, 1)\n\n        box = gui.vBox(self.controlArea, \"Target Variable\", addToLayout=False)\n        self.class_attrs = VariablesListItemModel()\n        self.class_attrs_view = VariablesListItemView(\n            acceptedType=(Orange.data.DiscreteVariable,\n                          Orange.data.ContinuousVariable))\n        self.class_attrs_view.setModel(self.class_attrs)\n        self.class_attrs_view.selectionModel().selectionChanged.connect(\n            partial(update_on_change, self.class_attrs_view))\n        self.class_attrs_view.dragDropActionDidComplete.connect(dropcompleted)\n        self.class_attrs_view.setMaximumHeight(72)\n        box.layout().addWidget(self.class_attrs_view)\n        layout.addWidget(box, 1, 2, 1, 1)\n\n        box = gui.vBox(self.controlArea, \"Meta Attributes\", addToLayout=False)\n        self.meta_attrs = VariablesListItemModel()\n        self.meta_attrs_view = VariablesListItemView(\n            acceptedType=Orange.data.Variable)\n        self.meta_attrs_view.setModel(self.meta_attrs)\n        self.meta_attrs_view.selectionModel().selectionChanged.connect(\n            partial(update_on_change, self.meta_attrs_view))\n        self.meta_attrs_view.dragDropActionDidComplete.connect(dropcompleted)\n        box.layout().addWidget(self.meta_attrs_view)\n        layout.addWidget(box, 2, 2, 1, 1)\n\n        bbox = gui.vBox(self.controlArea, addToLayout=False, margin=0)\n        layout.addWidget(bbox, 0, 1, 1, 1)\n\n        self.up_attr_button = gui.button(bbox, self, \"Up\",\n                                         callback=partial(self.move_up, self.used_attrs_view))\n        self.move_attr_button = gui.button(bbox, self, \">\",\n                                           callback=partial(self.move_selected,\n                                                            self.used_attrs_view)\n                                          )\n        self.down_attr_button = gui.button(bbox, self, \"Down\",\n                                           callback=partial(self.move_down, self.used_attrs_view))\n\n        bbox = gui.vBox(self.controlArea, addToLayout=False, margin=0)\n        layout.addWidget(bbox, 1, 1, 1, 1)\n\n        self.up_class_button = gui.button(bbox, self, \"Up\",\n                                          callback=partial(self.move_up, self.class_attrs_view))\n        self.move_class_button = gui.button(bbox, self, \">\",\n                                            callback=partial(self.move_selected,\n                                                             self.class_attrs_view)\n                                           )\n        self.down_class_button = gui.button(bbox, self, \"Down\",\n                                            callback=partial(self.move_down, self.class_attrs_view))\n\n        bbox = gui.vBox(self.controlArea, addToLayout=False, margin=0)\n        layout.addWidget(bbox, 2, 1, 1, 1)\n        self.up_meta_button = gui.button(bbox, self, \"Up\",\n                                         callback=partial(self.move_up, self.meta_attrs_view))\n        self.move_meta_button = gui.button(bbox, self, \">\",\n                                           callback=partial(self.move_selected,\n                                                            self.meta_attrs_view)\n                                          )\n        self.down_meta_button = gui.button(bbox, self, \"Down\",\n                                           callback=partial(self.move_down, self.meta_attrs_view))\n\n        autobox = gui.auto_send(None, self, \"auto_commit\")\n        layout.addWidget(autobox, 3, 0, 1, 3)\n        reset = gui.button(None, self, \"Reset\", callback=self.reset, width=120)\n        autobox.layout().insertWidget(0, reset)\n        autobox.layout().insertStretch(1, 20)\n\n        layout.setRowStretch(0, 4)\n        layout.setRowStretch(1, 0)\n        layout.setRowStretch(2, 2)\n        layout.setHorizontalSpacing(0)\n        self.controlArea.setLayout(layout)\n\n        self.output_data = None\n        self.original_completer_items = []\n\n        self.info.set_input_summary(self.info.NoInput)\n        self.info.set_output_summary(self.info.NoOutput)\n\n        self.resize(600, 600)\n\n    @property\n    def features_from_data_attributes(self):\n        if self.data is None or self.features is None:\n            return []\n        domain = self.data.domain\n        return [domain[feature.name] for feature in self.features\n                if feature.name in domain and domain[feature.name]\n                in domain.attributes]\n\n    def can_use_features(self):\n        return bool(self.features_from_data_attributes) and \\\n               self.features_from_data_attributes != self.used_attrs[:]\n\n    def __use_features_changed(self):  # Use input features check box\n        # Needs a check since callback is invoked before object is created\n        if not hasattr(self, \"use_features_box\"):\n            return\n        self.enable_used_attrs(not self.use_input_features)\n        if self.use_input_features and self.can_use_features():\n            self.use_features()\n        if not self.use_input_features:\n            self.enable_use_features_box()\n\n    def __use_features_clicked(self):  # Use input features button\n        self.use_features()\n\n    def __used_attrs_changed(self):\n        self.enable_use_features_box()\n\n    @Inputs.data\n    def set_data(self, data=None):\n        self.update_domain_role_hints()\n        self.closeContext()\n        self.domain_role_hints = {}\n\n        self.data = data\n        if data is None:\n            self.used_attrs[:] = []\n            self.class_attrs[:] = []\n            self.meta_attrs[:] = []\n            self.available_attrs[:] = []\n            self.info.set_input_summary(self.info.NoInput)\n            return\n\n        self.openContext(data)\n        all_vars = data.domain.variables + data.domain.metas\n\n        def attrs_for_role(role):\n            selected_attrs = [\n                attr for attr in all_vars if domain_hints[attr][0] == role\n            ]\n            return sorted(selected_attrs, key=lambda attr: domain_hints[attr][1])\n\n        domain = data.domain\n        domain_hints = {}\n        domain_hints.update(self._hints_from_seq(\"attribute\", domain.attributes))\n        domain_hints.update(self._hints_from_seq(\"meta\", domain.metas))\n        domain_hints.update(self._hints_from_seq(\"class\", domain.class_vars))\n        domain_hints.update(self.domain_role_hints)\n\n        self.used_attrs[:] = attrs_for_role(\"attribute\")\n        self.class_attrs[:] = attrs_for_role(\"class\")\n        self.meta_attrs[:] = attrs_for_role(\"meta\")\n        self.available_attrs[:] = attrs_for_role(\"available\")\n        self.info.set_input_summary(len(data), format_summary_details(data))\n\n    def update_domain_role_hints(self):\n        \"\"\" Update the domain hints to be stored in the widgets settings.\n        \"\"\"\n        hints = {}\n        hints.update(self._hints_from_seq(\"available\", self.available_attrs))\n        hints.update(self._hints_from_seq(\"attribute\", self.used_attrs))\n        hints.update(self._hints_from_seq(\"class\", self.class_attrs))\n        hints.update(self._hints_from_seq(\"meta\", self.meta_attrs))\n        self.domain_role_hints = hints\n\n    @staticmethod\n    def _hints_from_seq(role, model):\n        return [(attr, (role, i)) for i, attr in enumerate(model)]\n\n    @Inputs.features\n    def set_features(self, features):\n        self.features = features\n\n    def handleNewSignals(self):\n        self.check_data()\n        self.enable_used_attrs()\n        self.enable_use_features_box()\n        if self.use_input_features and self.features_from_data_attributes:\n            self.enable_used_attrs(False)\n            self.use_features()\n        self.unconditional_commit()\n\n    def check_data(self):\n        self.Warning.mismatching_domain.clear()\n        if self.data is not None and self.features is not None and \\\n                not self.features_from_data_attributes:\n            self.Warning.mismatching_domain()\n\n    def enable_used_attrs(self, enable=True):\n        self.up_attr_button.setEnabled(enable)\n        self.move_attr_button.setEnabled(enable)\n        self.down_attr_button.setEnabled(enable)\n        self.used_attrs_view.setEnabled(enable)\n        self.used_attrs_view.repaint()\n\n    def enable_use_features_box(self):\n        self.use_features_box.button.setEnabled(self.can_use_features())\n        enable_checkbox = bool(self.features_from_data_attributes)\n        self.use_features_box.setHidden(not enable_checkbox)\n        self.use_features_box.repaint()\n\n    def use_features(self):\n        attributes = self.features_from_data_attributes\n        available, used = self.available_attrs[:], self.used_attrs[:]\n        self.available_attrs[:] = [attr for attr in used + available\n                                   if attr not in attributes]\n        self.used_attrs[:] = attributes\n        self.commit()\n\n    @staticmethod\n    def selected_rows(view):\n        \"\"\" Return the selected rows in the view.\n        \"\"\"\n        rows = view.selectionModel().selectedRows()\n        model = view.model()\n        if isinstance(model, QSortFilterProxyModel):\n            rows = [model.mapToSource(r) for r in rows]\n        return [r.row() for r in rows]\n\n    def move_rows(self, view: QListView, offset: int, roles=(Qt.EditRole,)):\n        rows = [idx.row() for idx in view.selectionModel().selectedRows()]\n        model = view.model()  # type: QAbstractItemModel\n        rowcount = model.rowCount()\n        newrows = [min(max(0, row + offset), rowcount - 1) for row in rows]\n\n        def itemData(index):\n            return {role: model.data(index, role) for role in roles}\n\n        for row, newrow in sorted(zip(rows, newrows), reverse=offset > 0):\n            d1 = itemData(model.index(row, 0))\n            d2 = itemData(model.index(newrow, 0))\n            model.setItemData(model.index(row, 0), d2)\n            model.setItemData(model.index(newrow, 0), d1)\n\n        selection = QItemSelection()\n        for nrow in newrows:\n            index = model.index(nrow, 0)\n            selection.select(index, index)\n        view.selectionModel().select(\n            selection, QItemSelectionModel.ClearAndSelect)\n\n        self.commit()\n\n    def move_up(self, view: QListView):\n        self.move_rows(view, -1)\n\n    def move_down(self, view: QListView):\n        self.move_rows(view, 1)\n\n    def move_selected(self, view):\n        if self.selected_rows(view):\n            self.move_selected_from_to(view, self.available_attrs_view)\n        elif self.selected_rows(self.available_attrs_view):\n            self.move_selected_from_to(self.available_attrs_view, view)\n\n    def move_selected_from_to(self, src, dst):\n        self.move_from_to(src, dst, self.selected_rows(src))\n\n    def move_from_to(self, src, dst, rows):\n        src_model = source_model(src)\n        attrs = [src_model[r] for r in rows]\n\n        for s1, s2 in reversed(list(slices(rows))):\n            del src_model[s1:s2]\n\n        dst_model = source_model(dst)\n\n        dst_model.extend(attrs)\n\n        self.commit()\n\n    def __update_interface_state(self):\n        last_view = self.__last_active_view\n        if last_view is not None:\n            self.update_interface_state(last_view)\n\n    def update_interface_state(self, focus=None):\n        for view in [self.available_attrs_view, self.used_attrs_view,\n                     self.class_attrs_view, self.meta_attrs_view]:\n            if view is not focus and not view.hasFocus() \\\n                    and view.selectionModel().hasSelection():\n                view.selectionModel().clear()\n\n        def selected_vars(view):\n            model = source_model(view)\n            return [model[i] for i in self.selected_rows(view)]\n\n        available_selected = selected_vars(self.available_attrs_view)\n        attrs_selected = selected_vars(self.used_attrs_view)\n        class_selected = selected_vars(self.class_attrs_view)\n        meta_selected = selected_vars(self.meta_attrs_view)\n\n        available_types = set(map(type, available_selected))\n        all_primitive = all(var.is_primitive()\n                            for var in available_types)\n\n        move_attr_enabled = \\\n            ((available_selected and all_primitive) or attrs_selected) and \\\n            self.used_attrs_view.isEnabled()\n\n        self.move_attr_button.setEnabled(bool(move_attr_enabled))\n        if move_attr_enabled:\n            self.move_attr_button.setText(\">\" if available_selected else \"<\")\n\n        move_class_enabled = bool(all_primitive and available_selected) or class_selected\n\n        self.move_class_button.setEnabled(bool(move_class_enabled))\n        if move_class_enabled:\n            self.move_class_button.setText(\">\" if available_selected else \"<\")\n        move_meta_enabled = available_selected or meta_selected\n\n        self.move_meta_button.setEnabled(bool(move_meta_enabled))\n        if move_meta_enabled:\n            self.move_meta_button.setText(\">\" if available_selected else \"<\")\n\n        self.__last_active_view = None\n        self.__interface_update_timer.stop()\n\n    def commit(self):\n        self.update_domain_role_hints()\n        if self.data is not None:\n            attributes = list(self.used_attrs)\n            class_var = list(self.class_attrs)\n            metas = list(self.meta_attrs)\n\n            domain = Orange.data.Domain(attributes, class_var, metas)\n            newdata = self.data.transform(domain)\n            self.output_data = newdata\n            self.Outputs.data.send(newdata)\n            self.Outputs.features.send(AttributeList(attributes))\n            self.info.set_output_summary(len(newdata),\n                                         format_summary_details(newdata))\n        else:\n            self.output_data = None\n            self.Outputs.data.send(None)\n            self.Outputs.features.send(None)\n            self.info.set_output_summary(self.info.NoOutput)\n\n    def reset(self):\n        self.enable_used_attrs()\n        self.use_features_box.checkbox.setChecked(False)\n        if self.data is not None:\n            self.available_attrs[:] = []\n            self.used_attrs[:] = self.data.domain.attributes\n            self.class_attrs[:] = self.data.domain.class_vars\n            self.meta_attrs[:] = self.data.domain.metas\n            self.update_domain_role_hints()\n            self.commit()\n\n    def send_report(self):\n        if not self.data or not self.output_data:\n            return\n        in_domain, out_domain = self.data.domain, self.output_data.domain\n        self.report_domain(\"Input data\", self.data.domain)\n        if (in_domain.attributes, in_domain.class_vars, in_domain.metas) == (\n                out_domain.attributes, out_domain.class_vars, out_domain.metas):\n            self.report_paragraph(\"Output data\", \"No changes.\")\n        else:\n            self.report_domain(\"Output data\", self.output_data.domain)\n            diff = list(set(in_domain.variables + in_domain.metas) -\n                        set(out_domain.variables + out_domain.metas))\n            if diff:\n                text = \"%i (%s)\" % (len(diff), \", \".join(x.name for x in diff))\n                self.report_items(((\"Removed\", text),))\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    brown = Orange.data.Table(\"brown-selected\")\n    feats = AttributeList(brown.domain.attributes[:2])\n    WidgetPreview(OWSelectAttributes).run(set_data=brown, set_features=feats)\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/data/owselectcolumns.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "7bd8d5837",
                "new_commit_hash": "4e7abd40c",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/data/owselectcolumns.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/data/owselectcolumns.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 116,
                            "length": 6
                        },
                        "new_range": {
                            "start": 116,
                            "length": 9
                        },
                        "section": "class SelectAttributesDomainContextHandler(DomainContextHandler):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        return decoded",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def match(self, context, domain, attrs, metas):",
                                "type": "context"
                            },
                            {
                                "content": "        if context.attributes == attrs and context.metas == metas:",
                                "type": "added"
                            },
                            {
                                "content": "            return self.PERFECT_MATCH",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        if not \"domain_role_hints\" in context.values:",
                                "type": "context"
                            },
                            {
                                "content": "            return self.NO_MATCH",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/data/owselectcolumns.py",
                            "type": "class",
                            "name": "SelectAttributesDomainContextHandler",
                            "content": "class SelectAttributesDomainContextHandler(DomainContextHandler):\n    def encode_setting(self, context, setting, value):\n        if setting.name == 'domain_role_hints':\n            value = {(var.name, vartype(var)): role_i\n                     for var, role_i in value.items()}\n        return super().encode_setting(context, setting, value)\n\n    def decode_setting(self, setting, value, domain=None, *_args):\n        decoded = super().decode_setting(setting, value, domain)\n        if setting.name == 'domain_role_hints':\n            decoded = {domain[name]: role_i\n                       for (name, _), role_i in decoded.items()}\n        return decoded\n\n    def match(self, context, domain, attrs, metas):\n        if context.attributes == attrs and context.metas == metas:\n            return self.PERFECT_MATCH\n\n        if not \"domain_role_hints\" in context.values:\n            return self.NO_MATCH\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = context.values[\"domain_role_hints\"][0]\n        assigned = [desc for desc, (role, _) in value.items()\n                    if role != \"available\"]\n        if not assigned:\n            return self.NO_MATCH\n        return sum(all_vars.get(attr) == vtype for attr, vtype in assigned) \\\n               / len(assigned)\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        if setting.name != \"domain_role_hints\":\n            return super().filter_value(setting, data, domain, attrs, metas)\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = data[\"domain_role_hints\"][0].items()\n        data[\"domain_role_hints\"] = {desc: role_i\n                                     for desc, role_i in value\n                                     if all_vars.get(desc[0]) == desc[1]}",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 104,
                            "end_lineno": 144,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/data/owselectcolumns.py",
                            "type": "method",
                            "name": "SelectAttributesDomainContextHandler.match",
                            "content": "class SelectAttributesDomainContextHandler(DomainContextHandler):\n    def encode_setting(self, context, setting, value):\n        if setting.name == 'domain_role_hints':\n            value = {(var.name, vartype(var)): role_i\n                     for var, role_i in value.items()}\n        return super().encode_setting(context, setting, value)\n\n    def decode_setting(self, setting, value, domain=None, *_args):\n        decoded = super().decode_setting(setting, value, domain)\n        if setting.name == 'domain_role_hints':\n            decoded = {domain[name]: role_i\n                       for (name, _), role_i in decoded.items()}\n        return decoded\n\n    def match(self, context, domain, attrs, metas):\n        if context.attributes == attrs and context.metas == metas:\n            return self.PERFECT_MATCH\n\n        if not \"domain_role_hints\" in context.values:\n            return self.NO_MATCH\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = context.values[\"domain_role_hints\"][0]\n        assigned = [desc for desc, (role, _) in value.items()\n                    if role != \"available\"]\n        if not assigned:\n            return self.NO_MATCH\n        return sum(all_vars.get(attr) == vtype for attr, vtype in assigned) \\\n               / len(assigned)\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        if setting.name != \"domain_role_hints\":\n            return super().filter_value(setting, data, domain, attrs, metas)\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = data[\"domain_role_hints\"][0].items()\n        data[\"domain_role_hints\"] = {desc: role_i\n                                     for desc, role_i in value\n                                     if all_vars.get(desc[0]) == desc[1]}",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 118,
                            "end_lineno": 133,
                            "parent": {
                                "file_name": "Orange/widgets/data/owselectcolumns.py",
                                "type": "class",
                                "name": "SelectAttributesDomainContextHandler",
                                "content": "class SelectAttributesDomainContextHandler(DomainContextHandler):\n    def encode_setting(self, context, setting, value):\n        if setting.name == 'domain_role_hints':\n            value = {(var.name, vartype(var)): role_i\n                     for var, role_i in value.items()}\n        return super().encode_setting(context, setting, value)\n\n    def decode_setting(self, setting, value, domain=None, *_args):\n        decoded = super().decode_setting(setting, value, domain)\n        if setting.name == 'domain_role_hints':\n            decoded = {domain[name]: role_i\n                       for (name, _), role_i in decoded.items()}\n        return decoded\n\n    def match(self, context, domain, attrs, metas):\n        if context.attributes == attrs and context.metas == metas:\n            return self.PERFECT_MATCH\n\n        if not \"domain_role_hints\" in context.values:\n            return self.NO_MATCH\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = context.values[\"domain_role_hints\"][0]\n        assigned = [desc for desc, (role, _) in value.items()\n                    if role != \"available\"]\n        if not assigned:\n            return self.NO_MATCH\n        return sum(all_vars.get(attr) == vtype for attr, vtype in assigned) \\\n               / len(assigned)\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        if setting.name != \"domain_role_hints\":\n            return super().filter_value(setting, data, domain, attrs, metas)\n\n        all_vars = attrs.copy()\n        all_vars.update(metas)\n        value = data[\"domain_role_hints\"][0].items()\n        data[\"domain_role_hints\"] = {desc: role_i\n                                     for desc, role_i in value\n                                     if all_vars.get(desc[0]) == desc[1]}",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 104,
                                "end_lineno": 144,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "\"\"\"Widget Settings and Settings Handlers\n\nSettings are used to declare widget attributes that persist through sessions.\nWhen widget is removed or saved to a schema file, its settings are packed,\nserialized and stored. When a new widget is created, values of attributes\nmarked as settings are read from disk. When schema is loaded, attribute values\nare set to one stored in schema.\n\nEach widget has its own SettingsHandler that takes care of serializing and\nstoring of settings and SettingProvider that is incharge of reading and\nwriting the setting values.\n\nAll widgets extending from OWWidget use SettingsHandler, unless they\ndeclare otherwise. SettingsHandler ensures that setting attributes\nare replaced with default (last used) setting values when the widget is\ninitialized and stored when the widget is removed.\n\nWidgets with settings whose values depend on the widget inputs use\nsettings handlers based on ContextHandler. These handlers have two\nadditional methods, open_context and close_context.\n\nopen_context is called when widgets receives new data. It finds a suitable\ncontext and sets the widget attributes to the values stored in context.\nIf no suitable context exists, a new one is created and values from widget\nare copied to it.\n\nclose_context stores values that were last used on the widget to the context\nso they can be used alter. It should be called before widget starts modifying\n(initializing) the value of the setting attributes.\n\"\"\"\n\n# Overriden methods in these classes add arguments\n# pylint: disable=arguments-differ,unused-argument,no-value-for-parameter\n\nimport copy\nimport itertools\nimport logging\nimport warnings\n\nfrom orangewidget.settings import (\n    Setting, SettingProvider, SettingsHandler, ContextSetting,\n    ContextHandler, Context, IncompatibleContext, SettingsPrinter,\n    rename_setting, widget_settings_dir\n)\nfrom orangewidget.settings import _apply_setting\n\nfrom Orange.data import Domain, Variable\nfrom Orange.util import OrangeDeprecationWarning\nfrom Orange.widgets.utils import vartype\n\nlog = logging.getLogger(__name__)\n\n__all__ = [\n    # re-exported from orangewidget.settings\n    \"Setting\", \"SettingsHandler\", \"SettingProvider\",\n    \"ContextSetting\", \"Context\", \"ContextHandler\", \"IncompatibleContext\",\n    \"rename_setting\", \"widget_settings_dir\",\n    # defined here\n    \"DomainContextHandler\", \"PerfectDomainContextHandler\",\n    \"ClassValuesContextHandler\", \"SettingsPrinter\",\n    \"migrate_str_to_variable\",\n]\n\n\nclass DomainContextHandler(ContextHandler):\n    \"\"\"Context handler for widgets with settings that depend on\n    the input dataset. Suitable settings are selected based on the\n    data domain.\"\"\"\n\n    MATCH_VALUES_NONE, MATCH_VALUES_CLASS, MATCH_VALUES_ALL = range(3)\n\n    def __init__(self, *, match_values=0, first_match=True, **kwargs):\n        super().__init__()\n        self.match_values = match_values\n        self.first_match = first_match\n\n        for name in kwargs:\n            warnings.warn(\n                \"{} is not a valid parameter for DomainContextHandler\"\n                .format(name), OrangeDeprecationWarning\n            )\n\n    def encode_domain(self, domain):\n        \"\"\"\n        domain: Orange.data.domain to encode\n        return: dict mapping attribute name to type or list of values\n                (based on the value of self.match_values attribute)\n        \"\"\"\n\n        match = self.match_values\n        encode = self.encode_variables\n        if match == self.MATCH_VALUES_CLASS:\n            attributes = encode(domain.attributes, False)\n            attributes.update(encode(domain.class_vars, True))\n        else:\n            attributes = encode(domain.variables, match == self.MATCH_VALUES_ALL)\n\n        metas = encode(domain.metas, match == self.MATCH_VALUES_ALL)\n\n        return attributes, metas\n\n    @staticmethod\n    def encode_variables(attributes, encode_values):\n        \"\"\"Encode variables to a list mapping name to variable type\n        or a list of values.\"\"\"\n\n        if not encode_values:\n            return {v.name: vartype(v) for v in attributes}\n\n        return {v.name: v.values if v.is_discrete else vartype(v)\n                for v in attributes}\n\n    def new_context(self, domain, attributes, metas):\n        \"\"\"Create a new context.\"\"\"\n        context = super().new_context()\n        context.attributes = attributes\n        context.metas = metas\n        return context\n\n    def open_context(self, widget, domain):\n        if domain is None:\n            return\n        if not isinstance(domain, Domain):\n            domain = domain.domain\n        super().open_context(widget, domain, *self.encode_domain(domain))\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        value = data.get(setting.name, None)\n        if isinstance(value, list):\n            new_value = [item for item in value\n                         if self.is_valid_item(setting, item, attrs, metas)]\n            data[setting.name] = new_value\n        elif isinstance(value, dict):\n            new_value = {item: val for item, val in value.items()\n                         if self.is_valid_item(setting, item, attrs, metas)}\n            data[setting.name] = new_value\n        elif self.is_encoded_var(value) \\\n                and not self._var_exists(setting, value, attrs, metas):\n            del data[setting.name]\n\n    @staticmethod\n    def encode_variable(var):\n        return var.name, 100 + vartype(var)\n\n    @classmethod\n    def encode_setting(cls, context, setting, value):\n        if isinstance(value, list):\n            if all(e is None or isinstance(e, Variable) for e in value) \\\n                    and any(e is not None for e in value):\n                return ([None if e is None else cls.encode_variable(e)\n                         for e in value],\n                        -3)\n            else:\n                return copy.copy(value)\n\n        elif isinstance(value, dict) \\\n                and all(isinstance(e, Variable) for e in value):\n            return ({cls.encode_variable(e): val for e, val in value.items()},\n                    -4)\n\n        if isinstance(value, Variable):\n            if isinstance(setting, ContextSetting):\n                return cls.encode_variable(value)\n            else:\n                raise ValueError(\"Variables must be stored as ContextSettings; \"\n                                 f\"change {setting.name} to ContextSetting.\")\n\n        return copy.copy(value), -2\n\n    # backward compatibility, pylint: disable=keyword-arg-before-vararg\n    def decode_setting(self, setting, value, domain=None, *args):\n        def get_var(name):\n            if domain is None:\n                raise ValueError(\"Cannot decode variable without domain\")\n            return domain[name]\n\n        if isinstance(value, tuple):\n            data, dtype = value\n            if dtype == -3:\n                return[None if name_type is None else get_var(name_type[0])\n                       for name_type in data]\n            if dtype == -4:\n                return {get_var(name): val for (name, _), val in data.items()}\n            if dtype >= 100:\n                return get_var(data)\n            return value[0]\n        else:\n            return value\n\n    @classmethod\n    def _var_exists(cls, setting, value, attributes, metas):\n        if not cls.is_encoded_var(value):\n            return False\n\n        attr_name, attr_type = value\n        # attr_type used to be either 1-4 for variables stored as string\n        # settings, and 101-104 for variables stored as variables. The former is\n        # no longer supported, but we play it safe and still handle both here.\n        attr_type %= 100\n        return (not setting.exclude_attributes and\n                attributes.get(attr_name, -1) == attr_type or\n                not setting.exclude_metas and\n                metas.get(attr_name, -1) == attr_type)\n\n    def match(self, context, domain, attrs, metas):\n        matches = []\n        try:\n            for setting, data, _ in \\\n                    self.provider.traverse_settings(data=context.values):\n                if not isinstance(setting, ContextSetting):\n                    continue\n                value = data.get(setting.name, None)\n\n                if isinstance(value, list):\n                    matches.append(\n                        self.match_list(setting, value, context, attrs, metas))\n                # type check is a (not foolproof) check in case of a pair that\n                # would, by conincidence, have -3 or -4 as the second element\n                elif isinstance(value, tuple) and len(value) == 2 \\\n                       and (value[1] == -3 and isinstance(value[0], list)\n                            or (value[1] == -4 and isinstance(value[0], dict))):\n                    matches.append(self.match_list(setting, value[0], context,\n                                                   attrs, metas))\n                elif value is not None:\n                    matches.append(\n                        self.match_value(setting, value, attrs, metas))\n        except IncompatibleContext:\n            return self.NO_MATCH\n\n        if self.first_match and matches and sum(m[0] for m in matches):\n            return self.MATCH\n\n        matches.append((0, 0))\n        matched, available = [sum(m) for m in zip(*matches)]\n        return matched / available if available else 0.1\n\n    def match_list(self, setting, value, context, attrs, metas):\n        \"\"\"Match a list of values with the given context.\n        returns a tuple containing number of matched and all values.\n        \"\"\"\n        matched = 0\n        for item in value:\n            if self.is_valid_item(setting, item, attrs, metas):\n                matched += 1\n            elif setting.required == ContextSetting.REQUIRED:\n                raise IncompatibleContext()\n        return matched, len(value)\n\n    def match_value(self, setting, value, attrs, metas):\n        \"\"\"Match a single value \"\"\"\n        if value[1] < 0:\n            return 0, 0\n\n        if self._var_exists(setting, value, attrs, metas):\n            return 1, 1\n        elif setting.required == setting.OPTIONAL:\n            return 0, 1\n        else:\n            raise IncompatibleContext()\n\n    def is_valid_item(self, setting, item, attrs, metas):\n        \"\"\"Return True if given item can be used with attrs and metas\n\n        Subclasses can override this method to checks data in alternative\n        representations.\n        \"\"\"\n        if not isinstance(item, tuple):\n            return True\n        return self._var_exists(setting, item, attrs, metas)\n\n    @staticmethod\n    def is_encoded_var(value):\n        return isinstance(value, tuple) \\\n            and len(value) == 2 \\\n            and isinstance(value[0], str) and isinstance(value[1], int) \\\n            and value[1] >= 0\n\nclass ClassValuesContextHandler(ContextHandler):\n    \"\"\"Context handler used for widgets that work with\n    a single discrete variable\"\"\"\n\n    def open_context(self, widget, classes):\n        if isinstance(classes, Variable):\n            if classes.is_discrete:\n                classes = classes.values\n            else:\n                classes = None\n\n        super().open_context(widget, classes)\n\n    def new_context(self, classes):\n        context = super().new_context()\n        context.classes = classes\n        return context\n\n    def match(self, context, classes):\n        if isinstance(classes, Variable) and classes.is_continuous:\n            return (self.PERFECT_MATCH if context.classes is None\n                    else self.NO_MATCH)\n        else:\n            # variable.values used to be a list, and so were context.classes\n            # cast to tuple for compatibility with past contexts\n            if context.classes is not None and tuple(context.classes) == classes:\n                return self.PERFECT_MATCH\n            else:\n                return self.NO_MATCH\n\n\nclass PerfectDomainContextHandler(DomainContextHandler):\n    \"\"\"Context handler that matches a context only when\n    the same domain is available.\n\n    It uses a different encoding than the DomainContextHandler.\n    \"\"\"\n\n    def new_context(self, domain, attributes, class_vars, metas):\n        \"\"\"Same as DomainContextHandler, but also store class_vars\"\"\"\n        context = super().new_context(domain, attributes, metas)\n        context.class_vars = class_vars\n        return context\n\n    def clone_context(self, old_context, *args):\n        \"\"\"Copy of context is always valid, since widgets are using\n        the same domain.\"\"\"\n        context = self.new_context(*args)\n        context.values = copy.deepcopy(old_context.values)\n        return context\n\n    def encode_domain(self, domain):\n        \"\"\"Encode domain into tuples (name, type)\n        A tuple is returned for each of attributes, class_vars and metas.\n        \"\"\"\n\n        if self.match_values == self.MATCH_VALUES_ALL:\n            def _encode(attrs):\n                return tuple((v.name, list(v.values) if v.is_discrete else vartype(v))\n                             for v in attrs)\n        else:\n            def _encode(attrs):\n                return tuple((v.name, vartype(v)) for v in attrs)\n        return (_encode(domain.attributes),\n                _encode(domain.class_vars),\n                _encode(domain.metas))\n\n    def match(self, context, domain, attributes, class_vars, metas):\n        \"\"\"Context only matches when domains are the same\"\"\"\n\n        return (self.PERFECT_MATCH\n                if (context.attributes == attributes and\n                    context.class_vars == class_vars and\n                    context.metas == metas)\n                else self.NO_MATCH)\n\n    def encode_setting(self, context, setting, value):\n        \"\"\"Same as is domain context handler, but handles separately stored\n        class_vars.\"\"\"\n\n        if isinstance(setting, ContextSetting) and isinstance(value, str):\n\n            def _candidate_variables():\n                if not setting.exclude_attributes:\n                    yield from itertools.chain(context.attributes,\n                                               context.class_vars)\n                if not setting.exclude_metas:\n                    yield from context.metas\n\n            for aname, atype in _candidate_variables():\n                if aname == value:\n                    return value, atype\n\n            return value, -1\n        else:\n            return super().encode_setting(context, setting, value)\n\n\ndef migrate_str_to_variable(settings, names=None, none_placeholder=None):\n    \"\"\"\n    Change variables stored as `(str, int)` to `(Variable, int)`.\n\n    Args:\n        settings (Context): context that is being migrated\n        names (sequence): names of settings to be migrated. If omitted,\n            all settings with values `(str, int)` are migrated.\n    \"\"\"\n    def _fix(name):\n        var, vtype = settings.values[name]\n        if 0 <= vtype <= 100:\n            settings.values[name] = (var, 100 + vtype)\n        elif var == none_placeholder and vtype == -2:\n            settings.values[name] = None\n\n    if names is None:\n        for name, setting in settings.values.items():\n            if DomainContextHandler.is_encoded_var(setting):\n                _fix(name)\n    elif isinstance(names, str):\n        _fix(names)\n    else:\n        for name in names:\n            _fix(name)\n",
            "new_file_content": "\"\"\"Widget Settings and Settings Handlers\n\nSettings are used to declare widget attributes that persist through sessions.\nWhen widget is removed or saved to a schema file, its settings are packed,\nserialized and stored. When a new widget is created, values of attributes\nmarked as settings are read from disk. When schema is loaded, attribute values\nare set to one stored in schema.\n\nEach widget has its own SettingsHandler that takes care of serializing and\nstoring of settings and SettingProvider that is incharge of reading and\nwriting the setting values.\n\nAll widgets extending from OWWidget use SettingsHandler, unless they\ndeclare otherwise. SettingsHandler ensures that setting attributes\nare replaced with default (last used) setting values when the widget is\ninitialized and stored when the widget is removed.\n\nWidgets with settings whose values depend on the widget inputs use\nsettings handlers based on ContextHandler. These handlers have two\nadditional methods, open_context and close_context.\n\nopen_context is called when widgets receives new data. It finds a suitable\ncontext and sets the widget attributes to the values stored in context.\nIf no suitable context exists, a new one is created and values from widget\nare copied to it.\n\nclose_context stores values that were last used on the widget to the context\nso they can be used alter. It should be called before widget starts modifying\n(initializing) the value of the setting attributes.\n\"\"\"\n\n# Overriden methods in these classes add arguments\n# pylint: disable=arguments-differ,unused-argument,no-value-for-parameter\n\nimport copy\nimport itertools\nimport logging\nimport warnings\n\nfrom orangewidget.settings import (\n    Setting, SettingProvider, SettingsHandler, ContextSetting,\n    ContextHandler, Context, IncompatibleContext, SettingsPrinter,\n    rename_setting, widget_settings_dir\n)\nfrom orangewidget.settings import _apply_setting\n\nfrom Orange.data import Domain, Variable\nfrom Orange.util import OrangeDeprecationWarning\nfrom Orange.widgets.utils import vartype\n\nlog = logging.getLogger(__name__)\n\n__all__ = [\n    # re-exported from orangewidget.settings\n    \"Setting\", \"SettingsHandler\", \"SettingProvider\",\n    \"ContextSetting\", \"Context\", \"ContextHandler\", \"IncompatibleContext\",\n    \"rename_setting\", \"widget_settings_dir\",\n    # defined here\n    \"DomainContextHandler\", \"PerfectDomainContextHandler\",\n    \"ClassValuesContextHandler\", \"SettingsPrinter\",\n    \"migrate_str_to_variable\",\n]\n\n\nclass DomainContextHandler(ContextHandler):\n    \"\"\"Context handler for widgets with settings that depend on\n    the input dataset. Suitable settings are selected based on the\n    data domain.\"\"\"\n\n    MATCH_VALUES_NONE, MATCH_VALUES_CLASS, MATCH_VALUES_ALL = range(3)\n\n    def __init__(self, *, match_values=0, first_match=True, **kwargs):\n        super().__init__()\n        self.match_values = match_values\n        self.first_match = first_match\n\n        for name in kwargs:\n            warnings.warn(\n                \"{} is not a valid parameter for DomainContextHandler\"\n                .format(name), OrangeDeprecationWarning\n            )\n\n    def encode_domain(self, domain):\n        \"\"\"\n        domain: Orange.data.domain to encode\n        return: dict mapping attribute name to type or list of values\n                (based on the value of self.match_values attribute)\n        \"\"\"\n\n        match = self.match_values\n        encode = self.encode_variables\n        if match == self.MATCH_VALUES_CLASS:\n            attributes = encode(domain.attributes, False)\n            attributes.update(encode(domain.class_vars, True))\n        else:\n            attributes = encode(domain.variables, match == self.MATCH_VALUES_ALL)\n\n        metas = encode(domain.metas, match == self.MATCH_VALUES_ALL)\n\n        return attributes, metas\n\n    @staticmethod\n    def encode_variables(attributes, encode_values):\n        \"\"\"Encode variables to a list mapping name to variable type\n        or a list of values.\"\"\"\n\n        if not encode_values:\n            return {v.name: vartype(v) for v in attributes}\n\n        return {v.name: v.values if v.is_discrete else vartype(v)\n                for v in attributes}\n\n    def new_context(self, domain, attributes, metas):\n        \"\"\"Create a new context.\"\"\"\n        context = super().new_context()\n        context.attributes = attributes\n        context.metas = metas\n        return context\n\n    def open_context(self, widget, domain):\n        if domain is None:\n            return\n        if not isinstance(domain, Domain):\n            domain = domain.domain\n        super().open_context(widget, domain, *self.encode_domain(domain))\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        value = data.get(setting.name, None)\n        if isinstance(value, list):\n            new_value = [item for item in value\n                         if self.is_valid_item(setting, item, attrs, metas)]\n            data[setting.name] = new_value\n        elif isinstance(value, dict):\n            new_value = {item: val for item, val in value.items()\n                         if self.is_valid_item(setting, item, attrs, metas)}\n            data[setting.name] = new_value\n        elif self.is_encoded_var(value) \\\n                and not self._var_exists(setting, value, attrs, metas):\n            del data[setting.name]\n\n    @staticmethod\n    def encode_variable(var):\n        return var.name, 100 + vartype(var)\n\n    @classmethod\n    def encode_setting(cls, context, setting, value):\n        if isinstance(value, list):\n            if all(e is None or isinstance(e, Variable) for e in value) \\\n                    and any(e is not None for e in value):\n                return ([None if e is None else cls.encode_variable(e)\n                         for e in value],\n                        -3)\n            else:\n                return copy.copy(value)\n\n        elif isinstance(value, dict) \\\n                and all(isinstance(e, Variable) for e in value):\n            return ({cls.encode_variable(e): val for e, val in value.items()},\n                    -4)\n\n        if isinstance(value, Variable):\n            if isinstance(setting, ContextSetting):\n                return cls.encode_variable(value)\n            else:\n                raise ValueError(\"Variables must be stored as ContextSettings; \"\n                                 f\"change {setting.name} to ContextSetting.\")\n\n        return copy.copy(value), -2\n\n    # backward compatibility, pylint: disable=keyword-arg-before-vararg\n    def decode_setting(self, setting, value, domain=None, *args):\n        def get_var(name):\n            if domain is None:\n                raise ValueError(\"Cannot decode variable without domain\")\n            return domain[name]\n\n        if isinstance(value, tuple):\n            data, dtype = value\n            if dtype == -3:\n                return[None if name_type is None else get_var(name_type[0])\n                       for name_type in data]\n            if dtype == -4:\n                return {get_var(name): val for (name, _), val in data.items()}\n            if dtype >= 100:\n                return get_var(data)\n            return value[0]\n        else:\n            return value\n\n    @classmethod\n    def _var_exists(cls, setting, value, attributes, metas):\n        if not cls.is_encoded_var(value):\n            return False\n\n        attr_name, attr_type = value\n        # attr_type used to be either 1-4 for variables stored as string\n        # settings, and 101-104 for variables stored as variables. The former is\n        # no longer supported, but we play it safe and still handle both here.\n        attr_type %= 100\n        return (not setting.exclude_attributes and\n                attributes.get(attr_name, -1) == attr_type or\n                not setting.exclude_metas and\n                metas.get(attr_name, -1) == attr_type)\n\n    def match(self, context, domain, attrs, metas):\n        if context.attributes == attrs and context.metas == metas:\n            return self.PERFECT_MATCH\n\n        matches = []\n        try:\n            for setting, data, _ in \\\n                    self.provider.traverse_settings(data=context.values):\n                if not isinstance(setting, ContextSetting):\n                    continue\n                value = data.get(setting.name, None)\n\n                if isinstance(value, list):\n                    matches.append(\n                        self.match_list(setting, value, context, attrs, metas))\n                # type check is a (not foolproof) check in case of a pair that\n                # would, by conincidence, have -3 or -4 as the second element\n                elif isinstance(value, tuple) and len(value) == 2 \\\n                       and (value[1] == -3 and isinstance(value[0], list)\n                            or (value[1] == -4 and isinstance(value[0], dict))):\n                    matches.append(self.match_list(setting, value[0], context,\n                                                   attrs, metas))\n                elif value is not None:\n                    matches.append(\n                        self.match_value(setting, value, attrs, metas))\n        except IncompatibleContext:\n            return self.NO_MATCH\n\n        if self.first_match and matches and sum(m[0] for m in matches):\n            return self.MATCH\n\n        matches.append((0, 0))\n        matched, available = [sum(m) for m in zip(*matches)]\n        return matched / available if available else 0.1\n\n    def match_list(self, setting, value, context, attrs, metas):\n        \"\"\"Match a list of values with the given context.\n        returns a tuple containing number of matched and all values.\n        \"\"\"\n        matched = 0\n        for item in value:\n            if self.is_valid_item(setting, item, attrs, metas):\n                matched += 1\n            elif setting.required == ContextSetting.REQUIRED:\n                raise IncompatibleContext()\n        return matched, len(value)\n\n    def match_value(self, setting, value, attrs, metas):\n        \"\"\"Match a single value \"\"\"\n        if value[1] < 0:\n            return 0, 0\n\n        if self._var_exists(setting, value, attrs, metas):\n            return 1, 1\n        elif setting.required == setting.OPTIONAL:\n            return 0, 1\n        else:\n            raise IncompatibleContext()\n\n    def is_valid_item(self, setting, item, attrs, metas):\n        \"\"\"Return True if given item can be used with attrs and metas\n\n        Subclasses can override this method to checks data in alternative\n        representations.\n        \"\"\"\n        if not isinstance(item, tuple):\n            return True\n        return self._var_exists(setting, item, attrs, metas)\n\n    @staticmethod\n    def is_encoded_var(value):\n        return isinstance(value, tuple) \\\n            and len(value) == 2 \\\n            and isinstance(value[0], str) and isinstance(value[1], int) \\\n            and value[1] >= 0\n\nclass ClassValuesContextHandler(ContextHandler):\n    \"\"\"Context handler used for widgets that work with\n    a single discrete variable\"\"\"\n\n    def open_context(self, widget, classes):\n        if isinstance(classes, Variable):\n            if classes.is_discrete:\n                classes = classes.values\n            else:\n                classes = None\n\n        super().open_context(widget, classes)\n\n    def new_context(self, classes):\n        context = super().new_context()\n        context.classes = classes\n        return context\n\n    def match(self, context, classes):\n        if isinstance(classes, Variable) and classes.is_continuous:\n            return (self.PERFECT_MATCH if context.classes is None\n                    else self.NO_MATCH)\n        else:\n            # variable.values used to be a list, and so were context.classes\n            # cast to tuple for compatibility with past contexts\n            if context.classes is not None and tuple(context.classes) == classes:\n                return self.PERFECT_MATCH\n            else:\n                return self.NO_MATCH\n\n\nclass PerfectDomainContextHandler(DomainContextHandler):\n    \"\"\"Context handler that matches a context only when\n    the same domain is available.\n\n    It uses a different encoding than the DomainContextHandler.\n    \"\"\"\n\n    def new_context(self, domain, attributes, class_vars, metas):\n        \"\"\"Same as DomainContextHandler, but also store class_vars\"\"\"\n        context = super().new_context(domain, attributes, metas)\n        context.class_vars = class_vars\n        return context\n\n    def clone_context(self, old_context, *args):\n        \"\"\"Copy of context is always valid, since widgets are using\n        the same domain.\"\"\"\n        context = self.new_context(*args)\n        context.values = copy.deepcopy(old_context.values)\n        return context\n\n    def encode_domain(self, domain):\n        \"\"\"Encode domain into tuples (name, type)\n        A tuple is returned for each of attributes, class_vars and metas.\n        \"\"\"\n\n        if self.match_values == self.MATCH_VALUES_ALL:\n            def _encode(attrs):\n                return tuple((v.name, list(v.values) if v.is_discrete else vartype(v))\n                             for v in attrs)\n        else:\n            def _encode(attrs):\n                return tuple((v.name, vartype(v)) for v in attrs)\n        return (_encode(domain.attributes),\n                _encode(domain.class_vars),\n                _encode(domain.metas))\n\n    def match(self, context, domain, attributes, class_vars, metas):\n        \"\"\"Context only matches when domains are the same\"\"\"\n\n        return (self.PERFECT_MATCH\n                if (context.attributes == attributes and\n                    context.class_vars == class_vars and\n                    context.metas == metas)\n                else self.NO_MATCH)\n\n    def encode_setting(self, context, setting, value):\n        \"\"\"Same as is domain context handler, but handles separately stored\n        class_vars.\"\"\"\n\n        if isinstance(setting, ContextSetting) and isinstance(value, str):\n\n            def _candidate_variables():\n                if not setting.exclude_attributes:\n                    yield from itertools.chain(context.attributes,\n                                               context.class_vars)\n                if not setting.exclude_metas:\n                    yield from context.metas\n\n            for aname, atype in _candidate_variables():\n                if aname == value:\n                    return value, atype\n\n            return value, -1\n        else:\n            return super().encode_setting(context, setting, value)\n\n\ndef migrate_str_to_variable(settings, names=None, none_placeholder=None):\n    \"\"\"\n    Change variables stored as `(str, int)` to `(Variable, int)`.\n\n    Args:\n        settings (Context): context that is being migrated\n        names (sequence): names of settings to be migrated. If omitted,\n            all settings with values `(str, int)` are migrated.\n    \"\"\"\n    def _fix(name):\n        var, vtype = settings.values[name]\n        if 0 <= vtype <= 100:\n            settings.values[name] = (var, 100 + vtype)\n        elif var == none_placeholder and vtype == -2:\n            settings.values[name] = None\n\n    if names is None:\n        for name, setting in settings.values.items():\n            if DomainContextHandler.is_encoded_var(setting):\n                _fix(name)\n    elif isinstance(names, str):\n        _fix(names)\n    else:\n        for name in names:\n            _fix(name)\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/settings.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "14fa183d1",
                "new_commit_hash": "3bbe31eb2",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/settings.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/settings.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 203,
                            "length": 6
                        },
                        "new_range": {
                            "start": 203,
                            "length": 9
                        },
                        "section": "class DomainContextHandler(ContextHandler):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "                metas.get(attr_name, -1) == attr_type)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def match(self, context, domain, attrs, metas):",
                                "type": "context"
                            },
                            {
                                "content": "        if context.attributes == attrs and context.metas == metas:",
                                "type": "added"
                            },
                            {
                                "content": "            return self.PERFECT_MATCH",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        matches = []",
                                "type": "context"
                            },
                            {
                                "content": "        try:",
                                "type": "context"
                            },
                            {
                                "content": "            for setting, data, _ in \\",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/settings.py",
                            "type": "method",
                            "name": "DomainContextHandler.match",
                            "content": "class DomainContextHandler(ContextHandler):\n    \"\"\"Context handler for widgets with settings that depend on\n    the input dataset. Suitable settings are selected based on the\n    data domain.\"\"\"\n\n    MATCH_VALUES_NONE, MATCH_VALUES_CLASS, MATCH_VALUES_ALL = range(3)\n\n    def __init__(self, *, match_values=0, first_match=True, **kwargs):\n        super().__init__()\n        self.match_values = match_values\n        self.first_match = first_match\n\n        for name in kwargs:\n            warnings.warn(\n                \"{} is not a valid parameter for DomainContextHandler\"\n                .format(name), OrangeDeprecationWarning\n            )\n\n    def encode_domain(self, domain):\n        \"\"\"\n        domain: Orange.data.domain to encode\n        return: dict mapping attribute name to type or list of values\n                (based on the value of self.match_values attribute)\n        \"\"\"\n\n        match = self.match_values\n        encode = self.encode_variables\n        if match == self.MATCH_VALUES_CLASS:\n            attributes = encode(domain.attributes, False)\n            attributes.update(encode(domain.class_vars, True))\n        else:\n            attributes = encode(domain.variables, match == self.MATCH_VALUES_ALL)\n\n        metas = encode(domain.metas, match == self.MATCH_VALUES_ALL)\n\n        return attributes, metas\n\n    @staticmethod\n    def encode_variables(attributes, encode_values):\n        \"\"\"Encode variables to a list mapping name to variable type\n        or a list of values.\"\"\"\n\n        if not encode_values:\n            return {v.name: vartype(v) for v in attributes}\n\n        return {v.name: v.values if v.is_discrete else vartype(v)\n                for v in attributes}\n\n    def new_context(self, domain, attributes, metas):\n        \"\"\"Create a new context.\"\"\"\n        context = super().new_context()\n        context.attributes = attributes\n        context.metas = metas\n        return context\n\n    def open_context(self, widget, domain):\n        if domain is None:\n            return\n        if not isinstance(domain, Domain):\n            domain = domain.domain\n        super().open_context(widget, domain, *self.encode_domain(domain))\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        value = data.get(setting.name, None)\n        if isinstance(value, list):\n            new_value = [item for item in value\n                         if self.is_valid_item(setting, item, attrs, metas)]\n            data[setting.name] = new_value\n        elif isinstance(value, dict):\n            new_value = {item: val for item, val in value.items()\n                         if self.is_valid_item(setting, item, attrs, metas)}\n            data[setting.name] = new_value\n        elif self.is_encoded_var(value) \\\n                and not self._var_exists(setting, value, attrs, metas):\n            del data[setting.name]\n\n    @staticmethod\n    def encode_variable(var):\n        return var.name, 100 + vartype(var)\n\n    @classmethod\n    def encode_setting(cls, context, setting, value):\n        if isinstance(value, list):\n            if all(e is None or isinstance(e, Variable) for e in value) \\\n                    and any(e is not None for e in value):\n                return ([None if e is None else cls.encode_variable(e)\n                         for e in value],\n                        -3)\n            else:\n                return copy.copy(value)\n\n        elif isinstance(value, dict) \\\n                and all(isinstance(e, Variable) for e in value):\n            return ({cls.encode_variable(e): val for e, val in value.items()},\n                    -4)\n\n        if isinstance(value, Variable):\n            if isinstance(setting, ContextSetting):\n                return cls.encode_variable(value)\n            else:\n                raise ValueError(\"Variables must be stored as ContextSettings; \"\n                                 f\"change {setting.name} to ContextSetting.\")\n\n        return copy.copy(value), -2\n\n    # backward compatibility, pylint: disable=keyword-arg-before-vararg\n    def decode_setting(self, setting, value, domain=None, *args):\n        def get_var(name):\n            if domain is None:\n                raise ValueError(\"Cannot decode variable without domain\")\n            return domain[name]\n\n        if isinstance(value, tuple):\n            data, dtype = value\n            if dtype == -3:\n                return[None if name_type is None else get_var(name_type[0])\n                       for name_type in data]\n            if dtype == -4:\n                return {get_var(name): val for (name, _), val in data.items()}\n            if dtype >= 100:\n                return get_var(data)\n            return value[0]\n        else:\n            return value\n\n    @classmethod\n    def _var_exists(cls, setting, value, attributes, metas):\n        if not cls.is_encoded_var(value):\n            return False\n\n        attr_name, attr_type = value\n        # attr_type used to be either 1-4 for variables stored as string\n        # settings, and 101-104 for variables stored as variables. The former is\n        # no longer supported, but we play it safe and still handle both here.\n        attr_type %= 100\n        return (not setting.exclude_attributes and\n                attributes.get(attr_name, -1) == attr_type or\n                not setting.exclude_metas and\n                metas.get(attr_name, -1) == attr_type)\n\n    def match(self, context, domain, attrs, metas):\n        if context.attributes == attrs and context.metas == metas:\n            return self.PERFECT_MATCH\n\n        matches = []\n        try:\n            for setting, data, _ in \\\n                    self.provider.traverse_settings(data=context.values):\n                if not isinstance(setting, ContextSetting):\n                    continue\n                value = data.get(setting.name, None)\n\n                if isinstance(value, list):\n                    matches.append(\n                        self.match_list(setting, value, context, attrs, metas))\n                # type check is a (not foolproof) check in case of a pair that\n                # would, by conincidence, have -3 or -4 as the second element\n                elif isinstance(value, tuple) and len(value) == 2 \\\n                       and (value[1] == -3 and isinstance(value[0], list)\n                            or (value[1] == -4 and isinstance(value[0], dict))):\n                    matches.append(self.match_list(setting, value[0], context,\n                                                   attrs, metas))\n                elif value is not None:\n                    matches.append(\n                        self.match_value(setting, value, attrs, metas))\n        except IncompatibleContext:\n            return self.NO_MATCH\n\n        if self.first_match and matches and sum(m[0] for m in matches):\n            return self.MATCH\n\n        matches.append((0, 0))\n        matched, available = [sum(m) for m in zip(*matches)]\n        return matched / available if available else 0.1\n\n    def match_list(self, setting, value, context, attrs, metas):\n        \"\"\"Match a list of values with the given context.\n        returns a tuple containing number of matched and all values.\n        \"\"\"\n        matched = 0\n        for item in value:\n            if self.is_valid_item(setting, item, attrs, metas):\n                matched += 1\n            elif setting.required == ContextSetting.REQUIRED:\n                raise IncompatibleContext()\n        return matched, len(value)\n\n    def match_value(self, setting, value, attrs, metas):\n        \"\"\"Match a single value \"\"\"\n        if value[1] < 0:\n            return 0, 0\n\n        if self._var_exists(setting, value, attrs, metas):\n            return 1, 1\n        elif setting.required == setting.OPTIONAL:\n            return 0, 1\n        else:\n            raise IncompatibleContext()\n\n    def is_valid_item(self, setting, item, attrs, metas):\n        \"\"\"Return True if given item can be used with attrs and metas\n\n        Subclasses can override this method to checks data in alternative\n        representations.\n        \"\"\"\n        if not isinstance(item, tuple):\n            return True\n        return self._var_exists(setting, item, attrs, metas)\n\n    @staticmethod\n    def is_encoded_var(value):\n        return isinstance(value, tuple) \\\n            and len(value) == 2 \\\n            and isinstance(value[0], str) and isinstance(value[1], int) \\\n            and value[1] >= 0",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 205,
                            "end_lineno": 238,
                            "parent": {
                                "file_name": "Orange/widgets/settings.py",
                                "type": "class",
                                "name": "DomainContextHandler",
                                "content": "class DomainContextHandler(ContextHandler):\n    \"\"\"Context handler for widgets with settings that depend on\n    the input dataset. Suitable settings are selected based on the\n    data domain.\"\"\"\n\n    MATCH_VALUES_NONE, MATCH_VALUES_CLASS, MATCH_VALUES_ALL = range(3)\n\n    def __init__(self, *, match_values=0, first_match=True, **kwargs):\n        super().__init__()\n        self.match_values = match_values\n        self.first_match = first_match\n\n        for name in kwargs:\n            warnings.warn(\n                \"{} is not a valid parameter for DomainContextHandler\"\n                .format(name), OrangeDeprecationWarning\n            )\n\n    def encode_domain(self, domain):\n        \"\"\"\n        domain: Orange.data.domain to encode\n        return: dict mapping attribute name to type or list of values\n                (based on the value of self.match_values attribute)\n        \"\"\"\n\n        match = self.match_values\n        encode = self.encode_variables\n        if match == self.MATCH_VALUES_CLASS:\n            attributes = encode(domain.attributes, False)\n            attributes.update(encode(domain.class_vars, True))\n        else:\n            attributes = encode(domain.variables, match == self.MATCH_VALUES_ALL)\n\n        metas = encode(domain.metas, match == self.MATCH_VALUES_ALL)\n\n        return attributes, metas\n\n    @staticmethod\n    def encode_variables(attributes, encode_values):\n        \"\"\"Encode variables to a list mapping name to variable type\n        or a list of values.\"\"\"\n\n        if not encode_values:\n            return {v.name: vartype(v) for v in attributes}\n\n        return {v.name: v.values if v.is_discrete else vartype(v)\n                for v in attributes}\n\n    def new_context(self, domain, attributes, metas):\n        \"\"\"Create a new context.\"\"\"\n        context = super().new_context()\n        context.attributes = attributes\n        context.metas = metas\n        return context\n\n    def open_context(self, widget, domain):\n        if domain is None:\n            return\n        if not isinstance(domain, Domain):\n            domain = domain.domain\n        super().open_context(widget, domain, *self.encode_domain(domain))\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        value = data.get(setting.name, None)\n        if isinstance(value, list):\n            new_value = [item for item in value\n                         if self.is_valid_item(setting, item, attrs, metas)]\n            data[setting.name] = new_value\n        elif isinstance(value, dict):\n            new_value = {item: val for item, val in value.items()\n                         if self.is_valid_item(setting, item, attrs, metas)}\n            data[setting.name] = new_value\n        elif self.is_encoded_var(value) \\\n                and not self._var_exists(setting, value, attrs, metas):\n            del data[setting.name]\n\n    @staticmethod\n    def encode_variable(var):\n        return var.name, 100 + vartype(var)\n\n    @classmethod\n    def encode_setting(cls, context, setting, value):\n        if isinstance(value, list):\n            if all(e is None or isinstance(e, Variable) for e in value) \\\n                    and any(e is not None for e in value):\n                return ([None if e is None else cls.encode_variable(e)\n                         for e in value],\n                        -3)\n            else:\n                return copy.copy(value)\n\n        elif isinstance(value, dict) \\\n                and all(isinstance(e, Variable) for e in value):\n            return ({cls.encode_variable(e): val for e, val in value.items()},\n                    -4)\n\n        if isinstance(value, Variable):\n            if isinstance(setting, ContextSetting):\n                return cls.encode_variable(value)\n            else:\n                raise ValueError(\"Variables must be stored as ContextSettings; \"\n                                 f\"change {setting.name} to ContextSetting.\")\n\n        return copy.copy(value), -2\n\n    # backward compatibility, pylint: disable=keyword-arg-before-vararg\n    def decode_setting(self, setting, value, domain=None, *args):\n        def get_var(name):\n            if domain is None:\n                raise ValueError(\"Cannot decode variable without domain\")\n            return domain[name]\n\n        if isinstance(value, tuple):\n            data, dtype = value\n            if dtype == -3:\n                return[None if name_type is None else get_var(name_type[0])\n                       for name_type in data]\n            if dtype == -4:\n                return {get_var(name): val for (name, _), val in data.items()}\n            if dtype >= 100:\n                return get_var(data)\n            return value[0]\n        else:\n            return value\n\n    @classmethod\n    def _var_exists(cls, setting, value, attributes, metas):\n        if not cls.is_encoded_var(value):\n            return False\n\n        attr_name, attr_type = value\n        # attr_type used to be either 1-4 for variables stored as string\n        # settings, and 101-104 for variables stored as variables. The former is\n        # no longer supported, but we play it safe and still handle both here.\n        attr_type %= 100\n        return (not setting.exclude_attributes and\n                attributes.get(attr_name, -1) == attr_type or\n                not setting.exclude_metas and\n                metas.get(attr_name, -1) == attr_type)\n\n    def match(self, context, domain, attrs, metas):\n        if context.attributes == attrs and context.metas == metas:\n            return self.PERFECT_MATCH\n\n        matches = []\n        try:\n            for setting, data, _ in \\\n                    self.provider.traverse_settings(data=context.values):\n                if not isinstance(setting, ContextSetting):\n                    continue\n                value = data.get(setting.name, None)\n\n                if isinstance(value, list):\n                    matches.append(\n                        self.match_list(setting, value, context, attrs, metas))\n                # type check is a (not foolproof) check in case of a pair that\n                # would, by conincidence, have -3 or -4 as the second element\n                elif isinstance(value, tuple) and len(value) == 2 \\\n                       and (value[1] == -3 and isinstance(value[0], list)\n                            or (value[1] == -4 and isinstance(value[0], dict))):\n                    matches.append(self.match_list(setting, value[0], context,\n                                                   attrs, metas))\n                elif value is not None:\n                    matches.append(\n                        self.match_value(setting, value, attrs, metas))\n        except IncompatibleContext:\n            return self.NO_MATCH\n\n        if self.first_match and matches and sum(m[0] for m in matches):\n            return self.MATCH\n\n        matches.append((0, 0))\n        matched, available = [sum(m) for m in zip(*matches)]\n        return matched / available if available else 0.1\n\n    def match_list(self, setting, value, context, attrs, metas):\n        \"\"\"Match a list of values with the given context.\n        returns a tuple containing number of matched and all values.\n        \"\"\"\n        matched = 0\n        for item in value:\n            if self.is_valid_item(setting, item, attrs, metas):\n                matched += 1\n            elif setting.required == ContextSetting.REQUIRED:\n                raise IncompatibleContext()\n        return matched, len(value)\n\n    def match_value(self, setting, value, attrs, metas):\n        \"\"\"Match a single value \"\"\"\n        if value[1] < 0:\n            return 0, 0\n\n        if self._var_exists(setting, value, attrs, metas):\n            return 1, 1\n        elif setting.required == setting.OPTIONAL:\n            return 0, 1\n        else:\n            raise IncompatibleContext()\n\n    def is_valid_item(self, setting, item, attrs, metas):\n        \"\"\"Return True if given item can be used with attrs and metas\n\n        Subclasses can override this method to checks data in alternative\n        representations.\n        \"\"\"\n        if not isinstance(item, tuple):\n            return True\n        return self._var_exists(setting, item, attrs, metas)\n\n    @staticmethod\n    def is_encoded_var(value):\n        return isinstance(value, tuple) \\\n            and len(value) == 2 \\\n            and isinstance(value[0], str) and isinstance(value[1], int) \\\n            and value[1] >= 0",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 65,
                                "end_lineno": 279,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/widgets/settings.py",
                            "type": "class",
                            "name": "DomainContextHandler",
                            "content": "class DomainContextHandler(ContextHandler):\n    \"\"\"Context handler for widgets with settings that depend on\n    the input dataset. Suitable settings are selected based on the\n    data domain.\"\"\"\n\n    MATCH_VALUES_NONE, MATCH_VALUES_CLASS, MATCH_VALUES_ALL = range(3)\n\n    def __init__(self, *, match_values=0, first_match=True, **kwargs):\n        super().__init__()\n        self.match_values = match_values\n        self.first_match = first_match\n\n        for name in kwargs:\n            warnings.warn(\n                \"{} is not a valid parameter for DomainContextHandler\"\n                .format(name), OrangeDeprecationWarning\n            )\n\n    def encode_domain(self, domain):\n        \"\"\"\n        domain: Orange.data.domain to encode\n        return: dict mapping attribute name to type or list of values\n                (based on the value of self.match_values attribute)\n        \"\"\"\n\n        match = self.match_values\n        encode = self.encode_variables\n        if match == self.MATCH_VALUES_CLASS:\n            attributes = encode(domain.attributes, False)\n            attributes.update(encode(domain.class_vars, True))\n        else:\n            attributes = encode(domain.variables, match == self.MATCH_VALUES_ALL)\n\n        metas = encode(domain.metas, match == self.MATCH_VALUES_ALL)\n\n        return attributes, metas\n\n    @staticmethod\n    def encode_variables(attributes, encode_values):\n        \"\"\"Encode variables to a list mapping name to variable type\n        or a list of values.\"\"\"\n\n        if not encode_values:\n            return {v.name: vartype(v) for v in attributes}\n\n        return {v.name: v.values if v.is_discrete else vartype(v)\n                for v in attributes}\n\n    def new_context(self, domain, attributes, metas):\n        \"\"\"Create a new context.\"\"\"\n        context = super().new_context()\n        context.attributes = attributes\n        context.metas = metas\n        return context\n\n    def open_context(self, widget, domain):\n        if domain is None:\n            return\n        if not isinstance(domain, Domain):\n            domain = domain.domain\n        super().open_context(widget, domain, *self.encode_domain(domain))\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        value = data.get(setting.name, None)\n        if isinstance(value, list):\n            new_value = [item for item in value\n                         if self.is_valid_item(setting, item, attrs, metas)]\n            data[setting.name] = new_value\n        elif isinstance(value, dict):\n            new_value = {item: val for item, val in value.items()\n                         if self.is_valid_item(setting, item, attrs, metas)}\n            data[setting.name] = new_value\n        elif self.is_encoded_var(value) \\\n                and not self._var_exists(setting, value, attrs, metas):\n            del data[setting.name]\n\n    @staticmethod\n    def encode_variable(var):\n        return var.name, 100 + vartype(var)\n\n    @classmethod\n    def encode_setting(cls, context, setting, value):\n        if isinstance(value, list):\n            if all(e is None or isinstance(e, Variable) for e in value) \\\n                    and any(e is not None for e in value):\n                return ([None if e is None else cls.encode_variable(e)\n                         for e in value],\n                        -3)\n            else:\n                return copy.copy(value)\n\n        elif isinstance(value, dict) \\\n                and all(isinstance(e, Variable) for e in value):\n            return ({cls.encode_variable(e): val for e, val in value.items()},\n                    -4)\n\n        if isinstance(value, Variable):\n            if isinstance(setting, ContextSetting):\n                return cls.encode_variable(value)\n            else:\n                raise ValueError(\"Variables must be stored as ContextSettings; \"\n                                 f\"change {setting.name} to ContextSetting.\")\n\n        return copy.copy(value), -2\n\n    # backward compatibility, pylint: disable=keyword-arg-before-vararg\n    def decode_setting(self, setting, value, domain=None, *args):\n        def get_var(name):\n            if domain is None:\n                raise ValueError(\"Cannot decode variable without domain\")\n            return domain[name]\n\n        if isinstance(value, tuple):\n            data, dtype = value\n            if dtype == -3:\n                return[None if name_type is None else get_var(name_type[0])\n                       for name_type in data]\n            if dtype == -4:\n                return {get_var(name): val for (name, _), val in data.items()}\n            if dtype >= 100:\n                return get_var(data)\n            return value[0]\n        else:\n            return value\n\n    @classmethod\n    def _var_exists(cls, setting, value, attributes, metas):\n        if not cls.is_encoded_var(value):\n            return False\n\n        attr_name, attr_type = value\n        # attr_type used to be either 1-4 for variables stored as string\n        # settings, and 101-104 for variables stored as variables. The former is\n        # no longer supported, but we play it safe and still handle both here.\n        attr_type %= 100\n        return (not setting.exclude_attributes and\n                attributes.get(attr_name, -1) == attr_type or\n                not setting.exclude_metas and\n                metas.get(attr_name, -1) == attr_type)\n\n    def match(self, context, domain, attrs, metas):\n        if context.attributes == attrs and context.metas == metas:\n            return self.PERFECT_MATCH\n\n        matches = []\n        try:\n            for setting, data, _ in \\\n                    self.provider.traverse_settings(data=context.values):\n                if not isinstance(setting, ContextSetting):\n                    continue\n                value = data.get(setting.name, None)\n\n                if isinstance(value, list):\n                    matches.append(\n                        self.match_list(setting, value, context, attrs, metas))\n                # type check is a (not foolproof) check in case of a pair that\n                # would, by conincidence, have -3 or -4 as the second element\n                elif isinstance(value, tuple) and len(value) == 2 \\\n                       and (value[1] == -3 and isinstance(value[0], list)\n                            or (value[1] == -4 and isinstance(value[0], dict))):\n                    matches.append(self.match_list(setting, value[0], context,\n                                                   attrs, metas))\n                elif value is not None:\n                    matches.append(\n                        self.match_value(setting, value, attrs, metas))\n        except IncompatibleContext:\n            return self.NO_MATCH\n\n        if self.first_match and matches and sum(m[0] for m in matches):\n            return self.MATCH\n\n        matches.append((0, 0))\n        matched, available = [sum(m) for m in zip(*matches)]\n        return matched / available if available else 0.1\n\n    def match_list(self, setting, value, context, attrs, metas):\n        \"\"\"Match a list of values with the given context.\n        returns a tuple containing number of matched and all values.\n        \"\"\"\n        matched = 0\n        for item in value:\n            if self.is_valid_item(setting, item, attrs, metas):\n                matched += 1\n            elif setting.required == ContextSetting.REQUIRED:\n                raise IncompatibleContext()\n        return matched, len(value)\n\n    def match_value(self, setting, value, attrs, metas):\n        \"\"\"Match a single value \"\"\"\n        if value[1] < 0:\n            return 0, 0\n\n        if self._var_exists(setting, value, attrs, metas):\n            return 1, 1\n        elif setting.required == setting.OPTIONAL:\n            return 0, 1\n        else:\n            raise IncompatibleContext()\n\n    def is_valid_item(self, setting, item, attrs, metas):\n        \"\"\"Return True if given item can be used with attrs and metas\n\n        Subclasses can override this method to checks data in alternative\n        representations.\n        \"\"\"\n        if not isinstance(item, tuple):\n            return True\n        return self._var_exists(setting, item, attrs, metas)\n\n    @staticmethod\n    def is_encoded_var(value):\n        return isinstance(value, tuple) \\\n            and len(value) == 2 \\\n            and isinstance(value[0], str) and isinstance(value[1], int) \\\n            and value[1] >= 0",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 65,
                            "end_lineno": 279,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nfrom unittest.mock import Mock\nimport numpy as np\n\nfrom AnyQt.QtCore import QItemSelectionModel\n\nfrom Orange.data import Table, Domain, DiscreteVariable, ContinuousVariable\nfrom Orange.widgets.settings import Context\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, datasets,\n    AnchorProjectionWidgetTestMixin\n)\nfrom Orange.widgets.tests.utils import simulate\nfrom Orange.widgets.visualize.owlinearprojection import (\n    OWLinearProjection, LinearProjectionVizRank, Placement\n)\nfrom Orange.widgets.visualize.utils import run_vizrank\n\n\nclass TestOWLinearProjection(WidgetTest, AnchorProjectionWidgetTestMixin,\n                             WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinearProjection)  # type: OWLinearProjection\n\n    def test_nan_plot(self):\n        data = datasets.missing_data_1()\n        self.send_signal(self.widget.Inputs.data, data)\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n        data.X[:, 0] = np.nan\n        data.Y[:] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.send_signal(self.widget.Inputs.data_subset, data[2:3])\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n    def test_buttons(self):\n        for btn in self.widget.radio_placement.buttons[:3]:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(btn.isEnabled())\n            btn.click()\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = LinearProjectionVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_bad_data(self):\n        w = self.widget\n        data = Table(\"iris\")[:20]\n        domain = data.domain\n        domain = Domain(\n            attributes=domain.attributes[:4], class_vars=DiscreteVariable(\"class\", values=(\"a\", )))\n        data = Table.from_numpy(domain=domain, X=data.X, Y=data.Y)\n        self.assertTrue(w.radio_placement.buttons[1].isEnabled())\n        self.send_signal(w.Inputs.data, data)\n        self.assertFalse(w.radio_placement.buttons[1].isEnabled())\n\n    def test_no_data_for_lda(self):\n        buttons = self.widget.radio_placement.buttons\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.assertFalse(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n\n    def test_data_no_cont_features(self):\n        data = Table(\"titanic\")\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n\n    def test_radius(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.widget.controls.graph.hide_radius.setValue(5)\n\n    def test_invalid_data(self):\n        def assertErrorShown(data, is_shown):\n            self.send_signal(self.widget.Inputs.data, data)\n            self.assertEqual(is_shown, self.widget.Error.no_valid_data.is_shown())\n\n        data = Table(\"iris\")[::30]\n        data[:, 0] = np.nan\n        for data, is_shown in zip([None, data, Table(\"iris\")[:30]], [False, True, False]):\n            assertErrorShown(data, is_shown)\n\n    def test_migrate_settings_from_version_1(self):\n        # Settings from Orange 3.4.0\n        settings = {\n            '__version__': 1,\n            'alpha_value': 255,\n            'auto_commit': True,\n            'class_density': False,\n            'context_settings': [\n                Context(attributes={'iris': 1,\n                                    'petal length': 2, 'petal width': 2,\n                                    'sepal length': 2, 'sepal width': 2},\n                        metas={},\n                        ordered_domain=[('sepal length', 2),\n                                        ('sepal width', 2),\n                                        ('petal length', 2),\n                                        ('petal width', 2),\n                                        ('iris', 1)],\n                        time=1504865133.098991,\n                        values={'__version__': 1,\n                                'color_index': (5, -2),\n                                'shape_index': (1, -2),\n                                'size_index': (1, -2),\n                                'variable_state': ({}, -2)})],\n            'jitter_value': 0,\n            'legend_anchor': ((1, 0), (1, 0)),\n            'point_size': 8,\n            'savedWidgetGeometry': None\n        }\n        w = self.create_widget(OWLinearProjection, stored_settings=settings)\n        iris = Table(\"iris\")\n        self.send_signal(w.Inputs.data, iris, widget=w)\n        self.assertEqual(w.graph.point_width, 8)\n        self.assertEqual(w.attr_color, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_shape, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_size, iris.domain[\"sepal length\"])\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        w.controls.graph.hide_radius.setSliderPosition(3)\n\n    def test_invalidated_model_selected(self):\n        model = self.widget.model_selected\n\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:3]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = [self.data.domain[3]]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_not_called()\n\n    def test_two_classes_dataset(self):\n        self.widget.radio_placement.buttons[1].click()\n        self.send_signal(self.widget.Inputs.data, Table(\"heart_disease\"))\n        self.assertFalse(self.widget.radio_placement.buttons[1].isEnabled())\n\n    def test_unique_name(self):\n        data = Table(\"iris\")\n        new = ContinuousVariable(\"C-y\")\n        d = Table.from_numpy(Domain(list(data.domain.attributes[:3])+[new],\n                                    class_vars=data.domain.class_vars), data.X,\n                             data.Y)\n        self.send_signal(self.widget.Inputs.data, d)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        metas = [\"C-x (1)\", \"C-y (1)\", \"Selected\"]\n        self.assertEqual([meta.name for meta in output.domain.metas], metas)\n\n\nclass LinProjVizRankTests(WidgetTest):\n    \"\"\"\n    Linear Projection VizRank tests are mostly done without threading.\n    This is because threads created with module coverage are not traced.\n    \"\"\"\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.data = Table(\"iris\")\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinearProjection)\n        self.vizrank = self.widget.vizrank\n\n    def test_discrete_class(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        run_vizrank(self.vizrank.compute_score,\n                    self.vizrank.iterate_states, None,\n                    [], 0, self.vizrank.state_count(), Mock())\n\n    def test_continuous_class(self):\n        data = Table(\"housing\")[::100]\n        self.send_signal(self.widget.Inputs.data, data)\n        run_vizrank(self.vizrank.compute_score,\n                    self.vizrank.iterate_states, None,\n                    [], 0, self.vizrank.state_count(), Mock())\n\n    def test_set_attrs(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        prev_selected = self.widget.selected_vars[:]\n        c1 = self.get_output(self.widget.Outputs.components)\n        self.vizrank.toggle()\n        self.process_events(until=lambda: not self.vizrank.keep_running)\n        self.assertEqual(len(self.vizrank.scores), self.vizrank.state_count())\n        self.vizrank.rank_table.selectionModel().select(\n            self.vizrank.rank_model.item(0, 0).index(),\n            QItemSelectionModel.ClearAndSelect\n        )\n        self.assertNotEqual(self.widget.selected_vars, prev_selected)\n        c2 = self.get_output(self.widget.Outputs.components)\n        self.assertNotEqual(c1.domain.attributes, c2.domain.attributes)\n\n\nif __name__ == \"__main__\":\n    import unittest\n    unittest.main()\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nfrom unittest.mock import Mock\nimport numpy as np\n\nfrom AnyQt.QtCore import QItemSelectionModel\n\nfrom Orange.data import Table, Domain, DiscreteVariable, ContinuousVariable\nfrom Orange.widgets.settings import Context\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, datasets,\n    AnchorProjectionWidgetTestMixin\n)\nfrom Orange.widgets.tests.utils import simulate\nfrom Orange.widgets.visualize.owlinearprojection import (\n    OWLinearProjection, LinearProjectionVizRank, Placement\n)\nfrom Orange.widgets.visualize.utils import run_vizrank\n\n\nclass TestOWLinearProjection(WidgetTest, AnchorProjectionWidgetTestMixin,\n                             WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinearProjection)  # type: OWLinearProjection\n\n    def test_nan_plot(self):\n        data = datasets.missing_data_1()\n        self.send_signal(self.widget.Inputs.data, data)\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n        data.X[:, 0] = np.nan\n        data.Y[:] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.send_signal(self.widget.Inputs.data_subset, data[2:3])\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n    def test_buttons(self):\n        for btn in self.widget.radio_placement.buttons[:3]:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(btn.isEnabled())\n            btn.click()\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = LinearProjectionVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_bad_data(self):\n        w = self.widget\n        data = Table(\"iris\")[:20]\n        domain = data.domain\n        domain = Domain(\n            attributes=domain.attributes[:4], class_vars=DiscreteVariable(\"class\", values=(\"a\", )))\n        data = Table.from_numpy(domain=domain, X=data.X, Y=data.Y)\n        self.assertTrue(w.radio_placement.buttons[1].isEnabled())\n        self.send_signal(w.Inputs.data, data)\n        self.assertFalse(w.radio_placement.buttons[1].isEnabled())\n\n    def test_no_data_for_lda(self):\n        buttons = self.widget.radio_placement.buttons\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.assertFalse(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n\n    def test_data_no_cont_features(self):\n        data = Table(\"titanic\")\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n\n    def test_radius(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.widget.controls.graph.hide_radius.setValue(5)\n\n    def test_invalid_data(self):\n        def assertErrorShown(data, is_shown):\n            self.send_signal(self.widget.Inputs.data, data)\n            self.assertEqual(is_shown, self.widget.Error.no_valid_data.is_shown())\n\n        data = Table(\"iris\")[::30]\n        data[:, 0] = np.nan\n        for data, is_shown in zip([None, data, Table(\"iris\")[:30]], [False, True, False]):\n            assertErrorShown(data, is_shown)\n\n    def test_migrate_settings_from_version_1(self):\n        # Settings from Orange 3.4.0\n        settings = {\n            '__version__': 1,\n            'alpha_value': 255,\n            'auto_commit': True,\n            'class_density': False,\n            'context_settings': [\n                Context(attributes={'iris': 1,\n                                    'petal length': 2, 'petal width': 2,\n                                    'sepal length': 2, 'sepal width': 2},\n                        metas={},\n                        ordered_domain=[('sepal length', 2),\n                                        ('sepal width', 2),\n                                        ('petal length', 2),\n                                        ('petal width', 2),\n                                        ('iris', 1)],\n                        time=1504865133.098991,\n                        values={'__version__': 1,\n                                'color_index': (5, -2),\n                                'shape_index': (1, -2),\n                                'size_index': (1, -2),\n                                'variable_state': ({}, -2)})],\n            'jitter_value': 0,\n            'legend_anchor': ((1, 0), (1, 0)),\n            'point_size': 8,\n            'savedWidgetGeometry': None\n        }\n        w = self.create_widget(OWLinearProjection, stored_settings=settings)\n        iris = Table(\"iris\")\n        self.send_signal(w.Inputs.data, iris, widget=w)\n        self.assertEqual(w.graph.point_width, 8)\n        self.assertEqual(w.attr_color, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_shape, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_size, iris.domain[\"sepal length\"])\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        w.controls.graph.hide_radius.setSliderPosition(3)\n\n    def test_invalidated_model_selected(self):\n        model = self.widget.model_selected\n\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:3]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = [self.data.domain[3]]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n    def test_two_classes_dataset(self):\n        self.widget.radio_placement.buttons[1].click()\n        self.send_signal(self.widget.Inputs.data, Table(\"heart_disease\"))\n        self.assertFalse(self.widget.radio_placement.buttons[1].isEnabled())\n\n    def test_unique_name(self):\n        data = Table(\"iris\")\n        new = ContinuousVariable(\"C-y\")\n        d = Table.from_numpy(Domain(list(data.domain.attributes[:3])+[new],\n                                    class_vars=data.domain.class_vars), data.X,\n                             data.Y)\n        self.send_signal(self.widget.Inputs.data, d)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        metas = [\"C-x (1)\", \"C-y (1)\", \"Selected\"]\n        self.assertEqual([meta.name for meta in output.domain.metas], metas)\n\n\nclass LinProjVizRankTests(WidgetTest):\n    \"\"\"\n    Linear Projection VizRank tests are mostly done without threading.\n    This is because threads created with module coverage are not traced.\n    \"\"\"\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.data = Table(\"iris\")\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinearProjection)\n        self.vizrank = self.widget.vizrank\n\n    def test_discrete_class(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        run_vizrank(self.vizrank.compute_score,\n                    self.vizrank.iterate_states, None,\n                    [], 0, self.vizrank.state_count(), Mock())\n\n    def test_continuous_class(self):\n        data = Table(\"housing\")[::100]\n        self.send_signal(self.widget.Inputs.data, data)\n        run_vizrank(self.vizrank.compute_score,\n                    self.vizrank.iterate_states, None,\n                    [], 0, self.vizrank.state_count(), Mock())\n\n    def test_set_attrs(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        prev_selected = self.widget.selected_vars[:]\n        c1 = self.get_output(self.widget.Outputs.components)\n        self.vizrank.toggle()\n        self.process_events(until=lambda: not self.vizrank.keep_running)\n        self.assertEqual(len(self.vizrank.scores), self.vizrank.state_count())\n        self.vizrank.rank_table.selectionModel().select(\n            self.vizrank.rank_model.item(0, 0).index(),\n            QItemSelectionModel.ClearAndSelect\n        )\n        self.assertNotEqual(self.widget.selected_vars, prev_selected)\n        c2 = self.get_output(self.widget.Outputs.components)\n        self.assertNotEqual(c1.domain.attributes, c2.domain.attributes)\n\n\nif __name__ == \"__main__\":\n    import unittest\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/visualize/tests/test_owlinearprojection.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "f0f361d94",
                "new_commit_hash": "b0617355c",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/visualize/tests/test_owlinearprojection.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/visualize/tests/test_owlinearprojection.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 178,
                            "length": 7
                        },
                        "new_range": {
                            "start": 178,
                            "length": 7
                        },
                        "section": "class TestOWLinearProjection(WidgetTest, AnchorProjectionWidgetTestMixin,"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self.widget.setup_plot.reset_mock()",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, self.data)",
                                "type": "context"
                            },
                            {
                                "content": "        self.widget.setup_plot.assert_not_called()",
                                "type": "deleted"
                            },
                            {
                                "content": "        self.widget.setup_plot.assert_called_once()",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_two_classes_dataset(self):",
                                "type": "context"
                            },
                            {
                                "content": "        self.widget.radio_placement.buttons[1].click()",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owlinearprojection.py",
                            "type": "class",
                            "name": "TestOWLinearProjection",
                            "content": "class TestOWLinearProjection(WidgetTest, AnchorProjectionWidgetTestMixin,\n                             WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinearProjection)  # type: OWLinearProjection\n\n    def test_nan_plot(self):\n        data = datasets.missing_data_1()\n        self.send_signal(self.widget.Inputs.data, data)\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n        data.X[:, 0] = np.nan\n        data.Y[:] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.send_signal(self.widget.Inputs.data_subset, data[2:3])\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n    def test_buttons(self):\n        for btn in self.widget.radio_placement.buttons[:3]:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(btn.isEnabled())\n            btn.click()\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = LinearProjectionVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_bad_data(self):\n        w = self.widget\n        data = Table(\"iris\")[:20]\n        domain = data.domain\n        domain = Domain(\n            attributes=domain.attributes[:4], class_vars=DiscreteVariable(\"class\", values=(\"a\", )))\n        data = Table.from_numpy(domain=domain, X=data.X, Y=data.Y)\n        self.assertTrue(w.radio_placement.buttons[1].isEnabled())\n        self.send_signal(w.Inputs.data, data)\n        self.assertFalse(w.radio_placement.buttons[1].isEnabled())\n\n    def test_no_data_for_lda(self):\n        buttons = self.widget.radio_placement.buttons\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.assertFalse(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n\n    def test_data_no_cont_features(self):\n        data = Table(\"titanic\")\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n\n    def test_radius(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.widget.controls.graph.hide_radius.setValue(5)\n\n    def test_invalid_data(self):\n        def assertErrorShown(data, is_shown):\n            self.send_signal(self.widget.Inputs.data, data)\n            self.assertEqual(is_shown, self.widget.Error.no_valid_data.is_shown())\n\n        data = Table(\"iris\")[::30]\n        data[:, 0] = np.nan\n        for data, is_shown in zip([None, data, Table(\"iris\")[:30]], [False, True, False]):\n            assertErrorShown(data, is_shown)\n\n    def test_migrate_settings_from_version_1(self):\n        # Settings from Orange 3.4.0\n        settings = {\n            '__version__': 1,\n            'alpha_value': 255,\n            'auto_commit': True,\n            'class_density': False,\n            'context_settings': [\n                Context(attributes={'iris': 1,\n                                    'petal length': 2, 'petal width': 2,\n                                    'sepal length': 2, 'sepal width': 2},\n                        metas={},\n                        ordered_domain=[('sepal length', 2),\n                                        ('sepal width', 2),\n                                        ('petal length', 2),\n                                        ('petal width', 2),\n                                        ('iris', 1)],\n                        time=1504865133.098991,\n                        values={'__version__': 1,\n                                'color_index': (5, -2),\n                                'shape_index': (1, -2),\n                                'size_index': (1, -2),\n                                'variable_state': ({}, -2)})],\n            'jitter_value': 0,\n            'legend_anchor': ((1, 0), (1, 0)),\n            'point_size': 8,\n            'savedWidgetGeometry': None\n        }\n        w = self.create_widget(OWLinearProjection, stored_settings=settings)\n        iris = Table(\"iris\")\n        self.send_signal(w.Inputs.data, iris, widget=w)\n        self.assertEqual(w.graph.point_width, 8)\n        self.assertEqual(w.attr_color, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_shape, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_size, iris.domain[\"sepal length\"])\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        w.controls.graph.hide_radius.setSliderPosition(3)\n\n    def test_invalidated_model_selected(self):\n        model = self.widget.model_selected\n\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:3]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = [self.data.domain[3]]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_not_called()\n\n    def test_two_classes_dataset(self):\n        self.widget.radio_placement.buttons[1].click()\n        self.send_signal(self.widget.Inputs.data, Table(\"heart_disease\"))\n        self.assertFalse(self.widget.radio_placement.buttons[1].isEnabled())\n\n    def test_unique_name(self):\n        data = Table(\"iris\")\n        new = ContinuousVariable(\"C-y\")\n        d = Table.from_numpy(Domain(list(data.domain.attributes[:3])+[new],\n                                    class_vars=data.domain.class_vars), data.X,\n                             data.Y)\n        self.send_signal(self.widget.Inputs.data, d)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        metas = [\"C-x (1)\", \"C-y (1)\", \"Selected\"]\n        self.assertEqual([meta.name for meta in output.domain.metas], metas)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 21,
                            "end_lineno": 197,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owlinearprojection.py",
                            "type": "method",
                            "name": "TestOWLinearProjection.test_invalidated_model_selected",
                            "content": "class TestOWLinearProjection(WidgetTest, AnchorProjectionWidgetTestMixin,\n                             WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinearProjection)  # type: OWLinearProjection\n\n    def test_nan_plot(self):\n        data = datasets.missing_data_1()\n        self.send_signal(self.widget.Inputs.data, data)\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n        data.X[:, 0] = np.nan\n        data.Y[:] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.send_signal(self.widget.Inputs.data_subset, data[2:3])\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n    def test_buttons(self):\n        for btn in self.widget.radio_placement.buttons[:3]:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(btn.isEnabled())\n            btn.click()\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = LinearProjectionVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_bad_data(self):\n        w = self.widget\n        data = Table(\"iris\")[:20]\n        domain = data.domain\n        domain = Domain(\n            attributes=domain.attributes[:4], class_vars=DiscreteVariable(\"class\", values=(\"a\", )))\n        data = Table.from_numpy(domain=domain, X=data.X, Y=data.Y)\n        self.assertTrue(w.radio_placement.buttons[1].isEnabled())\n        self.send_signal(w.Inputs.data, data)\n        self.assertFalse(w.radio_placement.buttons[1].isEnabled())\n\n    def test_no_data_for_lda(self):\n        buttons = self.widget.radio_placement.buttons\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.assertFalse(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n\n    def test_data_no_cont_features(self):\n        data = Table(\"titanic\")\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n\n    def test_radius(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.widget.controls.graph.hide_radius.setValue(5)\n\n    def test_invalid_data(self):\n        def assertErrorShown(data, is_shown):\n            self.send_signal(self.widget.Inputs.data, data)\n            self.assertEqual(is_shown, self.widget.Error.no_valid_data.is_shown())\n\n        data = Table(\"iris\")[::30]\n        data[:, 0] = np.nan\n        for data, is_shown in zip([None, data, Table(\"iris\")[:30]], [False, True, False]):\n            assertErrorShown(data, is_shown)\n\n    def test_migrate_settings_from_version_1(self):\n        # Settings from Orange 3.4.0\n        settings = {\n            '__version__': 1,\n            'alpha_value': 255,\n            'auto_commit': True,\n            'class_density': False,\n            'context_settings': [\n                Context(attributes={'iris': 1,\n                                    'petal length': 2, 'petal width': 2,\n                                    'sepal length': 2, 'sepal width': 2},\n                        metas={},\n                        ordered_domain=[('sepal length', 2),\n                                        ('sepal width', 2),\n                                        ('petal length', 2),\n                                        ('petal width', 2),\n                                        ('iris', 1)],\n                        time=1504865133.098991,\n                        values={'__version__': 1,\n                                'color_index': (5, -2),\n                                'shape_index': (1, -2),\n                                'size_index': (1, -2),\n                                'variable_state': ({}, -2)})],\n            'jitter_value': 0,\n            'legend_anchor': ((1, 0), (1, 0)),\n            'point_size': 8,\n            'savedWidgetGeometry': None\n        }\n        w = self.create_widget(OWLinearProjection, stored_settings=settings)\n        iris = Table(\"iris\")\n        self.send_signal(w.Inputs.data, iris, widget=w)\n        self.assertEqual(w.graph.point_width, 8)\n        self.assertEqual(w.attr_color, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_shape, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_size, iris.domain[\"sepal length\"])\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        w.controls.graph.hide_radius.setSliderPosition(3)\n\n    def test_invalidated_model_selected(self):\n        model = self.widget.model_selected\n\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:3]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = [self.data.domain[3]]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_not_called()\n\n    def test_two_classes_dataset(self):\n        self.widget.radio_placement.buttons[1].click()\n        self.send_signal(self.widget.Inputs.data, Table(\"heart_disease\"))\n        self.assertFalse(self.widget.radio_placement.buttons[1].isEnabled())\n\n    def test_unique_name(self):\n        data = Table(\"iris\")\n        new = ContinuousVariable(\"C-y\")\n        d = Table.from_numpy(Domain(list(data.domain.attributes[:3])+[new],\n                                    class_vars=data.domain.class_vars), data.X,\n                             data.Y)\n        self.send_signal(self.widget.Inputs.data, d)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        metas = [\"C-x (1)\", \"C-y (1)\", \"Selected\"]\n        self.assertEqual([meta.name for meta in output.domain.metas], metas)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 159,
                            "end_lineno": 181,
                            "parent": {
                                "file_name": "Orange/widgets/visualize/tests/test_owlinearprojection.py",
                                "type": "class",
                                "name": "TestOWLinearProjection",
                                "content": "class TestOWLinearProjection(WidgetTest, AnchorProjectionWidgetTestMixin,\n                             WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinearProjection)  # type: OWLinearProjection\n\n    def test_nan_plot(self):\n        data = datasets.missing_data_1()\n        self.send_signal(self.widget.Inputs.data, data)\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n        data.X[:, 0] = np.nan\n        data.Y[:] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.send_signal(self.widget.Inputs.data_subset, data[2:3])\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n    def test_buttons(self):\n        for btn in self.widget.radio_placement.buttons[:3]:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(btn.isEnabled())\n            btn.click()\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = LinearProjectionVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_bad_data(self):\n        w = self.widget\n        data = Table(\"iris\")[:20]\n        domain = data.domain\n        domain = Domain(\n            attributes=domain.attributes[:4], class_vars=DiscreteVariable(\"class\", values=(\"a\", )))\n        data = Table.from_numpy(domain=domain, X=data.X, Y=data.Y)\n        self.assertTrue(w.radio_placement.buttons[1].isEnabled())\n        self.send_signal(w.Inputs.data, data)\n        self.assertFalse(w.radio_placement.buttons[1].isEnabled())\n\n    def test_no_data_for_lda(self):\n        buttons = self.widget.radio_placement.buttons\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.assertFalse(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n\n    def test_data_no_cont_features(self):\n        data = Table(\"titanic\")\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n\n    def test_radius(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.widget.controls.graph.hide_radius.setValue(5)\n\n    def test_invalid_data(self):\n        def assertErrorShown(data, is_shown):\n            self.send_signal(self.widget.Inputs.data, data)\n            self.assertEqual(is_shown, self.widget.Error.no_valid_data.is_shown())\n\n        data = Table(\"iris\")[::30]\n        data[:, 0] = np.nan\n        for data, is_shown in zip([None, data, Table(\"iris\")[:30]], [False, True, False]):\n            assertErrorShown(data, is_shown)\n\n    def test_migrate_settings_from_version_1(self):\n        # Settings from Orange 3.4.0\n        settings = {\n            '__version__': 1,\n            'alpha_value': 255,\n            'auto_commit': True,\n            'class_density': False,\n            'context_settings': [\n                Context(attributes={'iris': 1,\n                                    'petal length': 2, 'petal width': 2,\n                                    'sepal length': 2, 'sepal width': 2},\n                        metas={},\n                        ordered_domain=[('sepal length', 2),\n                                        ('sepal width', 2),\n                                        ('petal length', 2),\n                                        ('petal width', 2),\n                                        ('iris', 1)],\n                        time=1504865133.098991,\n                        values={'__version__': 1,\n                                'color_index': (5, -2),\n                                'shape_index': (1, -2),\n                                'size_index': (1, -2),\n                                'variable_state': ({}, -2)})],\n            'jitter_value': 0,\n            'legend_anchor': ((1, 0), (1, 0)),\n            'point_size': 8,\n            'savedWidgetGeometry': None\n        }\n        w = self.create_widget(OWLinearProjection, stored_settings=settings)\n        iris = Table(\"iris\")\n        self.send_signal(w.Inputs.data, iris, widget=w)\n        self.assertEqual(w.graph.point_width, 8)\n        self.assertEqual(w.attr_color, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_shape, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_size, iris.domain[\"sepal length\"])\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        w.controls.graph.hide_radius.setSliderPosition(3)\n\n    def test_invalidated_model_selected(self):\n        model = self.widget.model_selected\n\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:3]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = [self.data.domain[3]]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_not_called()\n\n    def test_two_classes_dataset(self):\n        self.widget.radio_placement.buttons[1].click()\n        self.send_signal(self.widget.Inputs.data, Table(\"heart_disease\"))\n        self.assertFalse(self.widget.radio_placement.buttons[1].isEnabled())\n\n    def test_unique_name(self):\n        data = Table(\"iris\")\n        new = ContinuousVariable(\"C-y\")\n        d = Table.from_numpy(Domain(list(data.domain.attributes[:3])+[new],\n                                    class_vars=data.domain.class_vars), data.X,\n                             data.Y)\n        self.send_signal(self.widget.Inputs.data, d)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        metas = [\"C-x (1)\", \"C-y (1)\", \"Selected\"]\n        self.assertEqual([meta.name for meta in output.domain.metas], metas)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 21,
                                "end_lineno": 197,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nfrom unittest.mock import Mock\nimport numpy as np\n\nfrom Orange.data import Table\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin,\n    AnchorProjectionWidgetTestMixin, datasets\n)\nfrom Orange.widgets.visualize.owradviz import OWRadviz, RadvizVizRank\n\n\nclass TestOWRadviz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                   WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        self.widget = self.create_widget(OWRadviz)\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = RadvizVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_no_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:, :0])\n\n    def test_not_enough_instances(self):\n        w = self.widget\n        self.assertFalse(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data[:1])\n        self.assertTrue(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data)\n        self.assertFalse(w.Error.no_instances.is_shown())\n\n    def test_saved_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        del self.widget.selected_vars[0]\n        selected = self.widget.selected_vars[:]\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWRadviz, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertListEqual(selected, self.widget.selected_vars)\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        selected = self.widget.selected_vars[:]\n        names = [a for a in self.heart_disease.domain.attributes\n                 if a.is_continuous or a.is_discrete and len(a.values) == 2]\n        self.assertListEqual(selected, names[:5])\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1],\n                      [0, 1.57, 3.14, -1.57]])\n        np.testing.assert_array_almost_equal(components.X, X, 2)\n        metas = [[\"radviz-x\"], [\"radviz-y\"], [\"angle\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[0.4472136, 0.894427], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X[:2], array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.removed_vars.is_shown())\n\n    def test_saved_selected_vars(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        self.widget.selected_vars[:] = self.data.domain[:1]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 1)\n\n        self.widget.selected_vars[:] = self.data.domain[:0]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 0)\n\n    def test_invalidated_model_selected(self):\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = self.data.domain[3:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_not_called()\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nfrom unittest.mock import Mock\nimport numpy as np\n\nfrom Orange.data import Table\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin,\n    AnchorProjectionWidgetTestMixin, datasets\n)\nfrom Orange.widgets.visualize.owradviz import OWRadviz, RadvizVizRank\n\n\nclass TestOWRadviz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                   WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        self.widget = self.create_widget(OWRadviz)\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = RadvizVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_no_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:, :0])\n\n    def test_not_enough_instances(self):\n        w = self.widget\n        self.assertFalse(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data[:1])\n        self.assertTrue(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data)\n        self.assertFalse(w.Error.no_instances.is_shown())\n\n    def test_saved_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        del self.widget.selected_vars[0]\n        selected = self.widget.selected_vars[:]\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWRadviz, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertListEqual(selected, self.widget.selected_vars)\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        selected = self.widget.selected_vars[:]\n        names = [a for a in self.heart_disease.domain.attributes\n                 if a.is_continuous or a.is_discrete and len(a.values) == 2]\n        self.assertListEqual(selected, names[:5])\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1],\n                      [0, 1.57, 3.14, -1.57]])\n        np.testing.assert_array_almost_equal(components.X, X, 2)\n        metas = [[\"radviz-x\"], [\"radviz-y\"], [\"angle\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[0.4472136, 0.894427], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X[:2], array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.removed_vars.is_shown())\n\n    def test_saved_selected_vars(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        self.widget.selected_vars[:] = self.data.domain[:1]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 1)\n\n        self.widget.selected_vars[:] = self.data.domain[:0]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 0)\n\n    def test_invalidated_model_selected(self):\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = self.data.domain[3:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/visualize/tests/test_owradviz.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "1fe471357",
                "new_commit_hash": "ed78ee9f9",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/visualize/tests/test_owradviz.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/visualize/tests/test_owradviz.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 128,
                            "length": 4
                        },
                        "new_range": {
                            "start": 128,
                            "length": 4
                        },
                        "section": "class TestOWRadviz(WidgetTest, AnchorProjectionWidgetTestMixin,"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self.widget.setup_plot.reset_mock()",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, self.data)",
                                "type": "context"
                            },
                            {
                                "content": "        self.widget.setup_plot.assert_not_called()",
                                "type": "deleted"
                            },
                            {
                                "content": "        self.widget.setup_plot.assert_called_once()",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owradviz.py",
                            "type": "class",
                            "name": "TestOWRadviz",
                            "content": "class TestOWRadviz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                   WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        self.widget = self.create_widget(OWRadviz)\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = RadvizVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_no_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:, :0])\n\n    def test_not_enough_instances(self):\n        w = self.widget\n        self.assertFalse(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data[:1])\n        self.assertTrue(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data)\n        self.assertFalse(w.Error.no_instances.is_shown())\n\n    def test_saved_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        del self.widget.selected_vars[0]\n        selected = self.widget.selected_vars[:]\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWRadviz, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertListEqual(selected, self.widget.selected_vars)\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        selected = self.widget.selected_vars[:]\n        names = [a for a in self.heart_disease.domain.attributes\n                 if a.is_continuous or a.is_discrete and len(a.values) == 2]\n        self.assertListEqual(selected, names[:5])\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1],\n                      [0, 1.57, 3.14, -1.57]])\n        np.testing.assert_array_almost_equal(components.X, X, 2)\n        metas = [[\"radviz-x\"], [\"radviz-y\"], [\"angle\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[0.4472136, 0.894427], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X[:2], array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.removed_vars.is_shown())\n\n    def test_saved_selected_vars(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        self.widget.selected_vars[:] = self.data.domain[:1]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 1)\n\n        self.widget.selected_vars[:] = self.data.domain[:0]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 0)\n\n    def test_invalidated_model_selected(self):\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = self.data.domain[3:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_not_called()",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 14,
                            "end_lineno": 131,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/visualize/tests/test_owradviz.py",
                            "type": "method",
                            "name": "TestOWRadviz.test_invalidated_model_selected",
                            "content": "class TestOWRadviz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                   WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        self.widget = self.create_widget(OWRadviz)\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = RadvizVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_no_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:, :0])\n\n    def test_not_enough_instances(self):\n        w = self.widget\n        self.assertFalse(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data[:1])\n        self.assertTrue(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data)\n        self.assertFalse(w.Error.no_instances.is_shown())\n\n    def test_saved_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        del self.widget.selected_vars[0]\n        selected = self.widget.selected_vars[:]\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWRadviz, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertListEqual(selected, self.widget.selected_vars)\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        selected = self.widget.selected_vars[:]\n        names = [a for a in self.heart_disease.domain.attributes\n                 if a.is_continuous or a.is_discrete and len(a.values) == 2]\n        self.assertListEqual(selected, names[:5])\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1],\n                      [0, 1.57, 3.14, -1.57]])\n        np.testing.assert_array_almost_equal(components.X, X, 2)\n        metas = [[\"radviz-x\"], [\"radviz-y\"], [\"angle\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[0.4472136, 0.894427], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X[:2], array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.removed_vars.is_shown())\n\n    def test_saved_selected_vars(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        self.widget.selected_vars[:] = self.data.domain[:1]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 1)\n\n        self.widget.selected_vars[:] = self.data.domain[:0]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 0)\n\n    def test_invalidated_model_selected(self):\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = self.data.domain[3:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_not_called()",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 111,
                            "end_lineno": 131,
                            "parent": {
                                "file_name": "Orange/widgets/visualize/tests/test_owradviz.py",
                                "type": "class",
                                "name": "TestOWRadviz",
                                "content": "class TestOWRadviz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                   WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        self.widget = self.create_widget(OWRadviz)\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = RadvizVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_no_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:, :0])\n\n    def test_not_enough_instances(self):\n        w = self.widget\n        self.assertFalse(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data[:1])\n        self.assertTrue(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data)\n        self.assertFalse(w.Error.no_instances.is_shown())\n\n    def test_saved_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        del self.widget.selected_vars[0]\n        selected = self.widget.selected_vars[:]\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWRadviz, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertListEqual(selected, self.widget.selected_vars)\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        selected = self.widget.selected_vars[:]\n        names = [a for a in self.heart_disease.domain.attributes\n                 if a.is_continuous or a.is_discrete and len(a.values) == 2]\n        self.assertListEqual(selected, names[:5])\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1],\n                      [0, 1.57, 3.14, -1.57]])\n        np.testing.assert_array_almost_equal(components.X, X, 2)\n        metas = [[\"radviz-x\"], [\"radviz-y\"], [\"angle\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[0.4472136, 0.894427], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X[:2], array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.removed_vars.is_shown())\n\n    def test_saved_selected_vars(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        self.widget.selected_vars[:] = self.data.domain[:1]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 1)\n\n        self.widget.selected_vars[:] = self.data.domain[:0]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 0)\n\n    def test_invalidated_model_selected(self):\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = self.data.domain[3:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_not_called()",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 14,
                                "end_lineno": 131,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "cc3e1f4a253031bb49da2a3ce183c690c3e9b55f^",
    "new_commit_hash": "cc3e1f4a253031bb49da2a3ce183c690c3e9b55f",
    "commit_message": "Merge pull request #5054 from janezd/domaincontext-perfect-match\n\nReintroduce PerfectMatch for domain context matching",
    "commit_date": "2020-11-06T11:52:47+01:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "cc3e1f4a253031bb49da2a3ce183c690c3e9b55f",
    "test_file_codes": [
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nfrom unittest.mock import Mock\nimport numpy as np\n\nfrom Orange.data import Table\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin,\n    AnchorProjectionWidgetTestMixin, datasets\n)\nfrom Orange.widgets.visualize.owradviz import OWRadviz, RadvizVizRank\n\n\nclass TestOWRadviz(WidgetTest, AnchorProjectionWidgetTestMixin,\n                   WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n        cls.heart_disease = Table(\"heart_disease\")\n\n    def setUp(self):\n        self.widget = self.create_widget(OWRadviz)\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = RadvizVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_no_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data[:, :0])\n\n    def test_not_enough_instances(self):\n        w = self.widget\n        self.assertFalse(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data[:1])\n        self.assertTrue(w.Error.no_instances.is_shown())\n        self.send_signal(w.Inputs.data, self.data)\n        self.assertFalse(w.Error.no_instances.is_shown())\n\n    def test_saved_features(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        del self.widget.selected_vars[0]\n        selected = self.widget.selected_vars[:]\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWRadviz, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertListEqual(selected, self.widget.selected_vars)\n        self.send_signal(self.widget.Inputs.data, self.heart_disease)\n        selected = self.widget.selected_vars[:]\n        names = [a for a in self.heart_disease.domain.attributes\n                 if a.is_continuous or a.is_discrete and len(a.values) == 2]\n        self.assertListEqual(selected, names[:5])\n\n    def test_output_components(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        components = self.get_output(self.widget.Outputs.components)\n        domain = components.domain\n        self.assertEqual(domain.attributes, self.data.domain.attributes)\n        self.assertEqual(domain.class_vars, ())\n        self.assertEqual([m.name for m in domain.metas], [\"component\"])\n        X = np.array([[1, 0, -1, 0], [0, 1, 0, -1],\n                      [0, 1.57, 3.14, -1.57]])\n        np.testing.assert_array_almost_equal(components.X, X, 2)\n        metas = [[\"radviz-x\"], [\"radviz-y\"], [\"angle\"]]\n        np.testing.assert_array_equal(components.metas, metas)\n\n    def test_manual_move(self):\n        super().test_manual_move()\n        array = np.array([[0.4472136, 0.894427], [0, 1], [-1, 0], [0, -1]])\n        np.testing.assert_array_almost_equal(\n            self.get_output(self.widget.Outputs.components).X[:2], array.T)\n\n    def test_discrete_attributes(self):\n        zoo = Table(\"zoo\")\n        self.send_signal(self.widget.Inputs.data, zoo)\n        self.assertTrue(self.widget.Warning.removed_vars.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Warning.removed_vars.is_shown())\n\n    def test_saved_selected_vars(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n\n        self.widget.selected_vars[:] = self.data.domain[:1]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 1)\n\n        self.widget.selected_vars[:] = self.data.domain[:0]\n        self.widget.model_selected.selection_changed.emit()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertEqual(len(self.widget.selected_vars[:]), 0)\n\n    def test_invalidated_model_selected(self):\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = self.data.domain[3:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n",
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\nfrom unittest.mock import Mock\nimport numpy as np\n\nfrom AnyQt.QtCore import QItemSelectionModel\n\nfrom Orange.data import Table, Domain, DiscreteVariable, ContinuousVariable\nfrom Orange.widgets.settings import Context\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, datasets,\n    AnchorProjectionWidgetTestMixin\n)\nfrom Orange.widgets.tests.utils import simulate\nfrom Orange.widgets.visualize.owlinearprojection import (\n    OWLinearProjection, LinearProjectionVizRank, Placement\n)\nfrom Orange.widgets.visualize.utils import run_vizrank\n\n\nclass TestOWLinearProjection(WidgetTest, AnchorProjectionWidgetTestMixin,\n                             WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n\n        cls.signal_name = \"Data\"\n        cls.signal_data = cls.data\n        cls.same_input_output_domain = False\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinearProjection)  # type: OWLinearProjection\n\n    def test_nan_plot(self):\n        data = datasets.missing_data_1()\n        self.send_signal(self.widget.Inputs.data, data)\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n        data.X[:, 0] = np.nan\n        data.Y[:] = np.nan\n        self.send_signal(self.widget.Inputs.data, data)\n        self.send_signal(self.widget.Inputs.data_subset, data[2:3])\n        simulate.combobox_run_through_all(self.widget.controls.attr_color)\n        simulate.combobox_run_through_all(self.widget.controls.attr_size)\n\n    def test_buttons(self):\n        for btn in self.widget.radio_placement.buttons[:3]:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(btn.isEnabled())\n            btn.click()\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = LinearProjectionVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n\n        check_vizrank(self.data)\n        check_vizrank(self.data[:, :3])\n        check_vizrank(None)\n        for ds in datasets.datasets():\n            check_vizrank(ds)\n\n    def test_bad_data(self):\n        w = self.widget\n        data = Table(\"iris\")[:20]\n        domain = data.domain\n        domain = Domain(\n            attributes=domain.attributes[:4], class_vars=DiscreteVariable(\"class\", values=(\"a\", )))\n        data = Table.from_numpy(domain=domain, X=data.X, Y=data.Y)\n        self.assertTrue(w.radio_placement.buttons[1].isEnabled())\n        self.send_signal(w.Inputs.data, data)\n        self.assertFalse(w.radio_placement.buttons[1].isEnabled())\n\n    def test_no_data_for_lda(self):\n        buttons = self.widget.radio_placement.buttons\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.assertFalse(buttons[Placement.LDA].isEnabled())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertTrue(buttons[Placement.LDA].isEnabled())\n\n    def test_data_no_cont_features(self):\n        data = Table(\"titanic\")\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, data)\n        self.assertTrue(self.widget.Error.no_cont_features.is_shown())\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(self.widget.Error.no_cont_features.is_shown())\n\n    def test_radius(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.radio_placement.buttons[Placement.LDA].click()\n        self.widget.controls.graph.hide_radius.setValue(5)\n\n    def test_invalid_data(self):\n        def assertErrorShown(data, is_shown):\n            self.send_signal(self.widget.Inputs.data, data)\n            self.assertEqual(is_shown, self.widget.Error.no_valid_data.is_shown())\n\n        data = Table(\"iris\")[::30]\n        data[:, 0] = np.nan\n        for data, is_shown in zip([None, data, Table(\"iris\")[:30]], [False, True, False]):\n            assertErrorShown(data, is_shown)\n\n    def test_migrate_settings_from_version_1(self):\n        # Settings from Orange 3.4.0\n        settings = {\n            '__version__': 1,\n            'alpha_value': 255,\n            'auto_commit': True,\n            'class_density': False,\n            'context_settings': [\n                Context(attributes={'iris': 1,\n                                    'petal length': 2, 'petal width': 2,\n                                    'sepal length': 2, 'sepal width': 2},\n                        metas={},\n                        ordered_domain=[('sepal length', 2),\n                                        ('sepal width', 2),\n                                        ('petal length', 2),\n                                        ('petal width', 2),\n                                        ('iris', 1)],\n                        time=1504865133.098991,\n                        values={'__version__': 1,\n                                'color_index': (5, -2),\n                                'shape_index': (1, -2),\n                                'size_index': (1, -2),\n                                'variable_state': ({}, -2)})],\n            'jitter_value': 0,\n            'legend_anchor': ((1, 0), (1, 0)),\n            'point_size': 8,\n            'savedWidgetGeometry': None\n        }\n        w = self.create_widget(OWLinearProjection, stored_settings=settings)\n        iris = Table(\"iris\")\n        self.send_signal(w.Inputs.data, iris, widget=w)\n        self.assertEqual(w.graph.point_width, 8)\n        self.assertEqual(w.attr_color, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_shape, iris.domain[\"iris\"])\n        self.assertEqual(w.attr_size, iris.domain[\"sepal length\"])\n\n    def test_set_radius_no_data(self):\n        \"\"\"\n        Widget should not crash when there is no data and radius slider is moved.\n        \"\"\"\n        w = self.widget\n        self.send_signal(w.Inputs.data, None)\n        w.controls.graph.hide_radius.setSliderPosition(3)\n\n    def test_invalidated_model_selected(self):\n        model = self.widget.model_selected\n\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:3]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n\n        self.widget.selected_vars[:] = [self.data.domain[3]]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n\n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n\n    def test_two_classes_dataset(self):\n        self.widget.radio_placement.buttons[1].click()\n        self.send_signal(self.widget.Inputs.data, Table(\"heart_disease\"))\n        self.assertFalse(self.widget.radio_placement.buttons[1].isEnabled())\n\n    def test_unique_name(self):\n        data = Table(\"iris\")\n        new = ContinuousVariable(\"C-y\")\n        d = Table.from_numpy(Domain(list(data.domain.attributes[:3])+[new],\n                                    class_vars=data.domain.class_vars), data.X,\n                             data.Y)\n        self.send_signal(self.widget.Inputs.data, d)\n        output = self.get_output(self.widget.Outputs.annotated_data)\n        metas = [\"C-x (1)\", \"C-y (1)\", \"Selected\"]\n        self.assertEqual([meta.name for meta in output.domain.metas], metas)\n\n\nclass LinProjVizRankTests(WidgetTest):\n    \"\"\"\n    Linear Projection VizRank tests are mostly done without threading.\n    This is because threads created with module coverage are not traced.\n    \"\"\"\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        cls.data = Table(\"iris\")\n\n    def setUp(self):\n        self.widget = self.create_widget(OWLinearProjection)\n        self.vizrank = self.widget.vizrank\n\n    def test_discrete_class(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        run_vizrank(self.vizrank.compute_score,\n                    self.vizrank.iterate_states, None,\n                    [], 0, self.vizrank.state_count(), Mock())\n\n    def test_continuous_class(self):\n        data = Table(\"housing\")[::100]\n        self.send_signal(self.widget.Inputs.data, data)\n        run_vizrank(self.vizrank.compute_score,\n                    self.vizrank.iterate_states, None,\n                    [], 0, self.vizrank.state_count(), Mock())\n\n    def test_set_attrs(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        prev_selected = self.widget.selected_vars[:]\n        c1 = self.get_output(self.widget.Outputs.components)\n        self.vizrank.toggle()\n        self.process_events(until=lambda: not self.vizrank.keep_running)\n        self.assertEqual(len(self.vizrank.scores), self.vizrank.state_count())\n        self.vizrank.rank_table.selectionModel().select(\n            self.vizrank.rank_model.item(0, 0).index(),\n            QItemSelectionModel.ClearAndSelect\n        )\n        self.assertNotEqual(self.widget.selected_vars, prev_selected)\n        c2 = self.get_output(self.widget.Outputs.components)\n        self.assertNotEqual(c1.domain.attributes, c2.domain.attributes)\n\n\nif __name__ == \"__main__\":\n    import unittest\n    unittest.main()\n"
    ],
    "test_file_names": [
        "test_1.py",
        "test_2.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\nrunning build_src\nbuild_src\nbuilding extension \"Orange.classification._simple_tree\" sources\nbuilding extension \"Orange.classification._tree_scorers\" sources\nbuilding extension \"Orange.data._valuecount\" sources\nbuilding extension \"Orange.data._contingency\" sources\nbuilding extension \"Orange.data._io\" sources\nbuilding extension \"Orange.data._variable\" sources\nbuilding extension \"Orange.distance._distance\" sources\nbuilding extension \"Orange.preprocess._discretize\" sources\nbuilding extension \"Orange.preprocess._relieff\" sources\nbuilding extension \"Orange.projection._som\" sources\nbuilding extension \"Orange.widgets.utils._grid_density\" sources\nbuild_src: building npy-pkg config files\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmpoapo8m5m/tmp\ncreating /tmp/tmpoapo8m5m/tmp/tmpoapo8m5m\ncompile options: '-MMD -MF /tmp/tmpoapo8m5m/file.c.d -c'\ncc: /tmp/tmpoapo8m5m/file.c\ncustomize UnixCCompiler using build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmpfz0cqay1/tmp\ncreating /tmp/tmpfz0cqay1/tmp/tmpfz0cqay1\ncompile options: '-MMD -MF /tmp/tmpfz0cqay1/file.c.d -c'\ncc: /tmp/tmpfz0cqay1/file.c\ncustomize UnixCCompiler using build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/classification/_simple_tree.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/classification/_tree_scorers.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_valuecount.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_contingency.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_io.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/data/_variable.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/distance/_distance.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/preprocess/_discretize.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncompiling C++ sources\nC compiler: c++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\nc++: Orange/preprocess/_relieff.cpp\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncompiling C sources\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\ncc: Orange/projection/_som.c\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncompiling C++ sources\nC compiler: c++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncompile options: '-I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c'\nc++: Orange/widgets/utils/_grid_density.cpp\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\nrunning develop\nrunning build_scripts\nrunning egg_info\nrunning build_src\nbuild_src\nbuilding extension \"Orange.classification._simple_tree\" sources\nbuilding extension \"Orange.classification._tree_scorers\" sources\nbuilding extension \"Orange.data._valuecount\" sources\nbuilding extension \"Orange.data._contingency\" sources\nbuilding extension \"Orange.data._io\" sources\nbuilding extension \"Orange.data._variable\" sources\nbuilding extension \"Orange.distance._distance\" sources\nbuilding extension \"Orange.preprocess._discretize\" sources\nbuilding extension \"Orange.preprocess._relieff\" sources\nbuilding extension \"Orange.projection._som\" sources\nbuilding extension \"Orange.widgets.utils._grid_density\" sources\nbuild_src: building npy-pkg config files\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching 'COPYING'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmp6ggxsfeu/tmp\ncreating /tmp/tmp6ggxsfeu/tmp/tmp6ggxsfeu\ncompile options: '-MMD -MF /tmp/tmp6ggxsfeu/file.c.d -c'\ncc: /tmp/tmp6ggxsfeu/file.c\ncustomize UnixCCompiler using build_ext\ncustomize UnixCCompiler\nC compiler: cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC\n\ncreating /tmp/tmp_m84jf5c/tmp\ncreating /tmp/tmp_m84jf5c/tmp/tmp_m84jf5c\ncompile options: '-MMD -MF /tmp/tmp_m84jf5c/file.c.d -c'\ncc: /tmp/tmp_m84jf5c/file.c\ncustomize UnixCCompiler using build_ext\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.28.0.dev0+cc3e1f4 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f\nProcessing dependencies for Orange3==3.28.0.dev0+cc3e1f4\nSearching for XlsxWriter==3.2.0\nBest match: XlsxWriter 3.2.0\nAdding XlsxWriter 3.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for setuptools==59.8.0\nBest match: setuptools 59.8.0\nAdding setuptools 59.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for scipy==1.7.3\nBest match: scipy 1.7.3\nAdding scipy 1.7.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for scikit-learn==1.0.2\nBest match: scikit-learn 1.0.2\nAdding scikit-learn 1.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for requests==2.31.0\nBest match: requests 2.31.0\nAdding requests 2.31.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for PyYAML==6.0.1\nBest match: PyYAML 6.0.1\nAdding PyYAML 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.12.4\nBest match: pyqtgraph 0.12.4\nAdding pyqtgraph 0.12.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for pip==24.0\nBest match: pip 24.0\nAdding pip 24.0 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for pandas==1.3.5\nBest match: pandas 1.3.5\nAdding pandas 1.3.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for orange-widget-base==4.22.0\nBest match: orange-widget-base 4.22.0\nAdding orange-widget-base 4.22.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for orange-canvas-core==0.1.35\nBest match: orange-canvas-core 0.1.35\nAdding orange-canvas-core 0.1.35 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for openpyxl==3.1.3\nBest match: openpyxl 3.1.3\nAdding openpyxl 3.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for numpy==1.17.5\nBest match: numpy 1.17.5\nAdding numpy 1.17.5 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for networkx==2.6.3\nBest match: networkx 2.6.3\nAdding networkx 2.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for matplotlib==3.5.3\nBest match: matplotlib 3.5.3\nAdding matplotlib 3.5.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for keyrings.alt==4.2.0\nBest match: keyrings.alt 4.2.0\nAdding keyrings.alt 4.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for keyring==24.1.1\nBest match: keyring 24.1.1\nAdding keyring 24.1.1 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for joblib==1.3.2\nBest match: joblib 1.3.2\nAdding joblib 1.3.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for httpx==0.14.3\nBest match: httpx 0.14.3\nAdding httpx 0.14.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for chardet==3.0.4\nBest match: chardet 3.0.4\nAdding chardet 3.0.4 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine==5.15.6\nBest match: PyQtWebEngine 5.15.6\nAdding PyQtWebEngine 5.15.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for PyQt5==5.15.10\nBest match: PyQt5 5.15.10\nAdding PyQt5 5.15.10 to easy-install.pth file\nInstalling pylupdate5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\nInstalling pyrcc5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\nInstalling pyuic5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for threadpoolctl==3.1.0\nBest match: threadpoolctl 3.1.0\nAdding threadpoolctl 3.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for urllib3==2.0.7\nBest match: urllib3 2.0.7\nAdding urllib3 2.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for typing-extensions==4.7.1\nBest match: typing-extensions 4.7.1\nAdding typing-extensions 4.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for packaging==24.0\nBest match: packaging 24.0\nAdding packaging 24.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for requests-cache==1.1.1\nBest match: requests-cache 1.1.1\nAdding requests-cache 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for importlib-metadata==6.7.0\nBest match: importlib-metadata 6.7.0\nAdding importlib-metadata 6.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for qasync==0.25.0\nBest match: qasync 0.25.0\nAdding qasync 0.25.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for et-xmlfile==1.1.0\nBest match: et-xmlfile 1.1.0\nAdding et-xmlfile 1.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for Pillow==9.5.0\nBest match: Pillow 9.5.0\nAdding Pillow 9.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for cycler==0.11.0\nBest match: cycler 0.11.0\nAdding cycler 0.11.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for kiwisolver==1.4.5\nBest match: kiwisolver 1.4.5\nAdding kiwisolver 1.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for fonttools==4.38.0\nBest match: fonttools 4.38.0\nAdding fonttools 4.38.0 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for jaraco.classes==3.2.3\nBest match: jaraco.classes 3.2.3\nAdding jaraco.classes 3.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for importlib-resources==5.12.0\nBest match: importlib-resources 5.12.0\nAdding importlib-resources 5.12.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for rfc3986==1.5.0\nBest match: rfc3986 1.5.0\nAdding rfc3986 1.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for httpcore==0.10.2\nBest match: httpcore 0.10.2\nAdding httpcore 0.10.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for PyQt5-sip==12.13.0\nBest match: PyQt5-sip 12.13.0\nAdding PyQt5-sip 12.13.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine-Qt5==5.15.16\nBest match: PyQtWebEngine-Qt5 5.15.16\nAdding PyQtWebEngine-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for PyQt5-Qt5==5.15.16\nBest match: PyQt5-Qt5 5.15.16\nAdding PyQt5-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for attrs==24.2.0\nBest match: attrs 24.2.0\nAdding attrs 24.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for cattrs==23.1.2\nBest match: cattrs 23.1.2\nAdding cattrs 23.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for platformdirs==4.0.0\nBest match: platformdirs 4.0.0\nAdding platformdirs 4.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for zipp==3.15.0\nBest match: zipp 3.15.0\nAdding zipp 3.15.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for more-itertools==9.1.0\nBest match: more-itertools 9.1.0\nAdding more-itertools 9.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for h11==0.9.0\nBest match: h11 0.9.0\nAdding h11 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for cffi==1.15.1\nBest match: cffi 1.15.1\nAdding cffi 1.15.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nSearching for pycparser==2.21\nBest match: pycparser 2.21\nAdding pycparser 2.21 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.28.0.dev0+cc3e1f4\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.7\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 164ms\nPrepared 18 packages in 35ms\nInstalled 18 packages in 71ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\nResolved 53 packages in 358ms\nInstalled 47 packages in 691ms\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.15.1\n + chardet==3.0.4\n + charset-normalizer==3.4.1\n + cryptography==44.0.0\n + cycler==0.11.0\n + et-xmlfile==1.1.0\n + fonttools==4.38.0\n + h11==0.9.0\n + httpcore==0.10.2\n + httpx==0.14.3\n + idna==3.10\n + importlib-resources==5.12.0\n + jaraco-classes==3.2.3\n + jeepney==0.8.0\n + joblib==1.3.2\n + keyring==24.1.1\n + keyrings-alt==4.2.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + more-itertools==9.1.0\n + networkx==2.6.3\n + openpyxl==3.1.3\n + opentsne==1.0.1\n + pandas==1.3.5\n + pillow==9.5.0\n + pip==24.0\n + pycparser==2.21\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.1\n + requests==2.31.0\n + rfc3986==1.5.0\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 39 packages in 69ms\nInstalled 13 packages in 153ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + platformdirs==4.0.0\n + pyqtgraph==0.12.4\n + qasync==0.25.0\n + requests-cache==1.1.1\n + url-normalize==1.4.3\nResolved 2 packages in 4ms\nInstalled 2 packages in 31ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nAudited 1 package in 67ms\nAudited 2 packages in 2ms\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3115:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3115 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4619:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4619 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5396:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5396 |           for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5517:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5517 |           __pyx_t_27 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5523:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5523 |           __pyx_t_27 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7051:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7051 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7741:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7741 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7801:143: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7801 |               __pyx_t_17 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_18 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                               ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:3881:24: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3881 |           __pyx_v_decs = (__pyx_v_decs / 10.0);\n      |           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:4070:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4070 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:480:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  480 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1301:7: note: ‘__pyx_v_attr_index’ was declared here\n 1301 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:2935:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2935 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:567:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:627:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:598:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3655:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3655 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3654:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3654 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4547:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4547 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4114:7: note: ‘__pyx_v_win_y’ was declared here\n 4114 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4536:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4536 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4113:7: note: ‘__pyx_v_win_x’ was declared here\n 4113 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:4746:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4746 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4745:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4745 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3141:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3141 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:2964:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2964 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2665:7: note: ‘__pyx_v_win_y’ was declared here\n 2665 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:2953:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 2953 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2664:7: note: ‘__pyx_v_win_x’ was declared here\n 2664 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5515:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5515 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5514:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5514 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/setuptools/command/easy_install.py:159: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.\n  EasyInstallDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f/.venv/lib/python3.7/site-packages/setuptools/command/egg_info.py:628: SetuptoolsDeprecationWarning: Custom 'build_py' does not implement 'get_data_files_without_manifest'.\nPlease extend command classes from setuptools instead of distutils.\n  SetuptoolsDeprecationWarning\n",
    "new_commit_res_code": 1,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f\ncollected 81 items\n\nr2e_tests/test_1.py sss..F.........F..F................                  [ 43%]\nr2e_tests/test_2.py sEsEsE..............F...F........................    [100%]\n\n==================================== ERRORS ====================================\n______________ ERROR at teardown of WidgetTest.test_image_export _______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_image_export>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n______________ ERROR at teardown of WidgetTest.test_minimum_size _______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_minimum_size>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n_____________ ERROR at teardown of WidgetTest.test_msg_base_class ______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_msg_base_class>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n=================================== FAILURES ===================================\n________________________ TestOWRadviz.test_btn_vizrank _________________________\n\nself = <r2e_tests.test_1.TestOWRadviz testMethod=test_btn_vizrank>\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = RadvizVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n    \n>       check_vizrank(self.data)\n\nr2e_tests/test_1.py:40: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nr2e_tests/test_1.py:38: in check_vizrank\n    self.assertIsNotNone(vizrank.compute_score(states[0]))\nOrange/widgets/visualize/owradviz.py:181: in compute_score\n    return -self._evaluate_projection(radviz_xy, y)\nOrange/widgets/visualize/owradviz.py:110: in _evaluate_projection\n    neigh.fit(x, y)\n.venv/lib/python3.7/site-packages/sklearn/neighbors/_classification.py:198: in fit\n    return self._fit(X, y)\n.venv/lib/python3.7/site-packages/sklearn/neighbors/_base.py:400: in _fit\n    X, y = self._validate_data(X, y, accept_sparse=\"csr\", multi_output=True)\n.venv/lib/python3.7/site-packages/sklearn/base.py:552: in _validate_data\n    self._check_feature_names(X, reset=reset)\n.venv/lib/python3.7/site-packages/sklearn/base.py:426: in _check_feature_names\n    feature_names_in = _get_feature_names(X)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nX = [[-0.311568, -0.403203 | Iris-setosa],\n [-0.273657, -0.310086 | Iris-setosa],\n [-0.193064, -0.256303 | Iris-setosa],\n [-0.20202, 0.00583182 | Iris-setosa],\n [-0.294345, -0.3609 | Iris-setosa],\n ...\n]\n\n    def _get_feature_names(X):\n        \"\"\"Get feature names from X.\n    \n        Support for other array containers should place its implementation here.\n    \n        Parameters\n        ----------\n        X : {ndarray, dataframe} of shape (n_samples, n_features)\n            Array container to extract feature names.\n    \n            - pandas dataframe : The columns will be considered to be feature\n              names. If the dataframe contains non-string feature names, `None` is\n              returned.\n            - All other array containers will return `None`.\n    \n        Returns\n        -------\n        names: ndarray or None\n            Feature names of `X`. Unrecognized array containers will return `None`.\n        \"\"\"\n        feature_names = None\n    \n        # extract feature names for support array containers\n        if hasattr(X, \"columns\"):\n            feature_names = np.asarray(X.columns, dtype=object)\n    \n>       if feature_names is None or len(feature_names) == 0:\nE       TypeError: len() of unsized object\n\n.venv/lib/python3.7/site-packages/sklearn/utils/validation.py:1679: TypeError\n_______________________ TestOWRadviz.test_in_out_summary _______________________\n\nself = <r2e_tests.test_1.TestOWRadviz testMethod=test_in_out_summary>\ntimeout = 5000\n\n    def test_in_out_summary(self, timeout=DEFAULT_TIMEOUT):\n        info = self.widget.info\n>       self.assertEqual(info._StateInfo__input_summary.brief, \"\")\nE       AssertionError: '-' != ''\nE       - -\nE       +\n\nOrange/widgets/tests/base.py:753: AssertionError\n________________________ TestOWRadviz.test_manual_move _________________________\n\nself = <r2e_tests.test_1.TestOWRadviz testMethod=test_manual_move>\n\n    def test_manual_move(self):\n>       super().test_manual_move()\n\nr2e_tests/test_1.py:86: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/widgets/tests/base.py:884: in test_manual_move\n    self.widget._manual_move(0, 1, 1)\nOrange/widgets/visualize/owradviz.py:415: in _manual_move\n    super()._manual_move(anchor_idx, np.cos(angle), np.sin(angle))\nOrange/widgets/visualize/utils/widget.py:728: in _manual_move\n    self.graph.update_coordinates()\nOrange/widgets/visualize/utils/component.py:60: in update_coordinates\n    super().update_coordinates()\nOrange/widgets/visualize/owscatterplotgraph.py:885: in update_coordinates\n    self._update_plot_coordinates(self.scatterplot_item, x, y)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Orange.widgets.visualize.owradviz.OWRadvizGraph object at 0x7d5b921cf0f0>\nplot = <Orange.widgets.visualize.owscatterplotgraph.ScatterPlotItem object at 0x7d5b8f741370>\nx = array([-0.20571715, -0.10116455, -0.28820332, -0.16653185, -0.094008  ,\n       -0.09659461, -0.06598064, -0.14803331, ...439238, -0.08518267,  0.0316945 ,  0.07265179,\n       -0.09168191,  0.11659768,  0.07767335, -0.0108475 , -0.0832802 ])\ny = array([ 2.98778047e-02,  5.40687996e-02, -2.39139559e-01,  2.05375732e-02,\n        6.89080239e-01,  7.43029470e-02,  1...5723e-01,  6.58325948e-01,  1.35779829e-01,\n        7.02271840e-01,  7.49812781e-01,  6.83453023e-01,  8.51848936e-02])\n\n    def _update_plot_coordinates(self, plot, x, y):\n        \"\"\"\n        Change the coordinates of points while keeping other properites.\n    \n        Asserts that the number of points stays the same.\n    \n        Note. Pyqtgraph does not offer a method for this: setting coordinates\n        invalidates other data. We therefore retrieve the data to set it\n        together with the coordinates. Pyqtgraph also does not offer a\n        (documented) method for retrieving the data, yet using\n        `plot.data[prop]` looks reasonably safe. The alternative, calling\n        update for every property would essentially reset the graph, which\n        can be time consuming.\n        \"\"\"\n        assert self.n_shown == len(x) == len(y)\n        data = dict(x=x, y=y)\n        for prop in ('pen', 'brush', 'size', 'symbol', 'data',\n                     'sourceRect', 'targetRect'):\n>           data[prop] = plot.data[prop]\nE           ValueError: no field of name targetRect\n\nOrange/widgets/visualize/owscatterplotgraph.py:855: ValueError\n__________________ TestOWLinearProjection.test_in_out_summary __________________\n\nself = <r2e_tests.test_2.TestOWLinearProjection testMethod=test_in_out_summary>\ntimeout = 5000\n\n    def test_in_out_summary(self, timeout=DEFAULT_TIMEOUT):\n        info = self.widget.info\n>       self.assertEqual(info._StateInfo__input_summary.brief, \"\")\nE       AssertionError: '-' != ''\nE       - -\nE       +\n\nOrange/widgets/tests/base.py:753: AssertionError\n___________________ TestOWLinearProjection.test_manual_move ____________________\n\nself = <r2e_tests.test_2.TestOWLinearProjection testMethod=test_manual_move>\n\n    def test_manual_move(self):\n        data = self.data.copy()\n        data[1, 0] = np.nan\n        nvalid, nsample = len(self.data) - 1, self.widget.SAMPLE_SIZE\n        self.send_signal(self.widget.Inputs.data, data)\n        self.widget.graph.select_by_indices(list(range(0, len(data), 10)))\n    \n        # remember state\n        selection = self.widget.graph.selection.copy()\n    \n        # simulate manual move\n        self.widget._manual_move_start()\n>       self.widget._manual_move(0, 1, 1)\n\nOrange/widgets/tests/base.py:884: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/widgets/visualize/utils/widget.py:728: in _manual_move\n    self.graph.update_coordinates()\nOrange/widgets/visualize/utils/component.py:60: in update_coordinates\n    super().update_coordinates()\nOrange/widgets/visualize/owscatterplotgraph.py:885: in update_coordinates\n    self._update_plot_coordinates(self.scatterplot_item, x, y)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Orange.widgets.visualize.owlinearprojection.OWLinProjGraph object at 0x7d5b79de1730>\nplot = <Orange.widgets.visualize.owscatterplotgraph.ScatterPlotItem object at 0x7d5b79df8410>\nx = array([-0.24179717, -0.04735272, -0.10290828,  0.00820283, -0.10290828,\n        0.20264728,  0.20264728, -0.15846383, ...957494,  0.11931394,  0.00820283,  0.09153617,\n        0.20264728,  0.28598061,  0.11931394, -0.13068606,  0.20264728])\ny = array([-0.34093587, -0.07345539, -0.30157634, -0.16845087,  0.09354074,\n       -0.14706601, -0.01148143, -0.12890112, ...310907, -0.06285806,  0.28069217,  0.4111683 ,\n       -0.08916116,  0.45336738,  0.30046704,  0.21871821, -0.05632984])\n\n    def _update_plot_coordinates(self, plot, x, y):\n        \"\"\"\n        Change the coordinates of points while keeping other properites.\n    \n        Asserts that the number of points stays the same.\n    \n        Note. Pyqtgraph does not offer a method for this: setting coordinates\n        invalidates other data. We therefore retrieve the data to set it\n        together with the coordinates. Pyqtgraph also does not offer a\n        (documented) method for retrieving the data, yet using\n        `plot.data[prop]` looks reasonably safe. The alternative, calling\n        update for every property would essentially reset the graph, which\n        can be time consuming.\n        \"\"\"\n        assert self.n_shown == len(x) == len(y)\n        data = dict(x=x, y=y)\n        for prop in ('pen', 'brush', 'size', 'symbol', 'data',\n                     'sourceRect', 'targetRect'):\n>           data[prop] = plot.data[prop]\nE           ValueError: no field of name targetRect\n\nOrange/widgets/visualize/owscatterplotgraph.py:855: ValueError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_attr_label_metas\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_attr_models\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_class_density\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_datasets\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_default_attrs\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_discrete_attributes\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_dragging_tooltip\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_embedding_missing_values\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_handle_primitive_metas\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_hidden_effective_variables\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_image_export\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_invalidated_embedding\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_invalidated_model_selected\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_no_features\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_none_data\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_not_enough_instances\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_output_components\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_outputs\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_plot_once\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_saved_features\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_saved_selected_vars\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_saved_selection\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_send_report\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_setup_graph\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_sparse_data\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_subset_data_color\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_visual_settings\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_attr_label_metas\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_attr_models\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_bad_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_btn_vizrank\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_buttons\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_class_density\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_data_no_cont_features\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_datasets\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_default_attrs\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_dragging_tooltip\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_embedding_missing_values\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_handle_primitive_metas\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_hidden_effective_variables\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_image_export\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_invalid_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_invalidated_embedding\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_invalidated_model_selected\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_migrate_settings_from_version_1\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_minimum_size\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_msg_base_class\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_nan_plot\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_no_data_for_lda\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_none_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_outputs\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_plot_once\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_radius\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_saved_selection\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_send_report\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_set_radius_no_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_setup_graph\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_sparse_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_subset_data_color\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_two_classes_dataset\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_unique_name\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_visual_settings\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_continuous_class\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_discrete_class\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_image_export\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_minimum_size\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_msg_base_class\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_set_attrs\nSKIPPED [2] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [2] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [2] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nERROR r2e_tests/test_2.py::WidgetTest::test_image_export - AttributeError: 'W...\nERROR r2e_tests/test_2.py::WidgetTest::test_minimum_size - AttributeError: 'W...\nERROR r2e_tests/test_2.py::WidgetTest::test_msg_base_class - AttributeError: ...\nFAILED r2e_tests/test_1.py::TestOWRadviz::test_btn_vizrank - TypeError: len()...\nFAILED r2e_tests/test_1.py::TestOWRadviz::test_in_out_summary - AssertionErro...\nFAILED r2e_tests/test_1.py::TestOWRadviz::test_manual_move - ValueError: no f...\nFAILED r2e_tests/test_2.py::TestOWLinearProjection::test_in_out_summary - Ass...\nFAILED r2e_tests/test_2.py::TestOWLinearProjection::test_manual_move - ValueE...\n============== 5 failed, 70 passed, 6 skipped, 3 errors in 17.97s ==============\nWidgets left: 0    Max widgets: 10014 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_cc3e1f4a253031bb49da2a3ce183c690c3e9b55f\ncollected 81 items\n\nr2e_tests/test_1.py sss..F.........F.FF................                  [ 43%]\nr2e_tests/test_2.py sEsEsE..............F..FF........................    [100%]\n\n==================================== ERRORS ====================================\n______________ ERROR at teardown of WidgetTest.test_image_export _______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_image_export>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n______________ ERROR at teardown of WidgetTest.test_minimum_size _______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_minimum_size>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n_____________ ERROR at teardown of WidgetTest.test_msg_base_class ______________\n\nself = <Orange.widgets.tests.base.WidgetTest testMethod=test_msg_base_class>\n\n    def tearDown(self):\n        \"\"\"Process any pending events before the next test is executed.\"\"\"\n>       self.signal_manager.clear()\nE       AttributeError: 'WidgetTest' object has no attribute 'signal_manager'\n\n.venv/lib/python3.7/site-packages/orangewidget/tests/base.py:309: AttributeError\n=================================== FAILURES ===================================\n________________________ TestOWRadviz.test_btn_vizrank _________________________\n\nself = <r2e_tests.test_1.TestOWRadviz testMethod=test_btn_vizrank>\n\n    def test_btn_vizrank(self):\n        def check_vizrank(data):\n            self.send_signal(self.widget.Inputs.data, data)\n            if data is not None and data.domain.class_var in \\\n                    self.widget.controls.attr_color.model():\n                self.widget.attr_color = data.domain.class_var\n            if self.widget.btn_vizrank.isEnabled():\n                vizrank = RadvizVizRank(self.widget)\n                states = [state for state in vizrank.iterate_states(None)]\n                self.assertIsNotNone(vizrank.compute_score(states[0]))\n    \n>       check_vizrank(self.data)\n\nr2e_tests/test_1.py:40: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nr2e_tests/test_1.py:38: in check_vizrank\n    self.assertIsNotNone(vizrank.compute_score(states[0]))\nOrange/widgets/visualize/owradviz.py:181: in compute_score\n    return -self._evaluate_projection(radviz_xy, y)\nOrange/widgets/visualize/owradviz.py:110: in _evaluate_projection\n    neigh.fit(x, y)\n.venv/lib/python3.7/site-packages/sklearn/neighbors/_classification.py:198: in fit\n    return self._fit(X, y)\n.venv/lib/python3.7/site-packages/sklearn/neighbors/_base.py:400: in _fit\n    X, y = self._validate_data(X, y, accept_sparse=\"csr\", multi_output=True)\n.venv/lib/python3.7/site-packages/sklearn/base.py:552: in _validate_data\n    self._check_feature_names(X, reset=reset)\n.venv/lib/python3.7/site-packages/sklearn/base.py:426: in _check_feature_names\n    feature_names_in = _get_feature_names(X)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nX = [[-0.311568, -0.403203 | Iris-setosa],\n [-0.273657, -0.310086 | Iris-setosa],\n [-0.193064, -0.256303 | Iris-setosa],\n [-0.20202, 0.00583182 | Iris-setosa],\n [-0.294345, -0.3609 | Iris-setosa],\n ...\n]\n\n    def _get_feature_names(X):\n        \"\"\"Get feature names from X.\n    \n        Support for other array containers should place its implementation here.\n    \n        Parameters\n        ----------\n        X : {ndarray, dataframe} of shape (n_samples, n_features)\n            Array container to extract feature names.\n    \n            - pandas dataframe : The columns will be considered to be feature\n              names. If the dataframe contains non-string feature names, `None` is\n              returned.\n            - All other array containers will return `None`.\n    \n        Returns\n        -------\n        names: ndarray or None\n            Feature names of `X`. Unrecognized array containers will return `None`.\n        \"\"\"\n        feature_names = None\n    \n        # extract feature names for support array containers\n        if hasattr(X, \"columns\"):\n            feature_names = np.asarray(X.columns, dtype=object)\n    \n>       if feature_names is None or len(feature_names) == 0:\nE       TypeError: len() of unsized object\n\n.venv/lib/python3.7/site-packages/sklearn/utils/validation.py:1679: TypeError\n_______________________ TestOWRadviz.test_in_out_summary _______________________\n\nself = <r2e_tests.test_1.TestOWRadviz testMethod=test_in_out_summary>\ntimeout = 5000\n\n    def test_in_out_summary(self, timeout=DEFAULT_TIMEOUT):\n        info = self.widget.info\n>       self.assertEqual(info._StateInfo__input_summary.brief, \"\")\nE       AssertionError: '-' != ''\nE       - -\nE       +\n\nOrange/widgets/tests/base.py:753: AssertionError\n_________________ TestOWRadviz.test_invalidated_model_selected _________________\n\nself = <r2e_tests.test_1.TestOWRadviz testMethod=test_invalidated_model_selected>\n\n    def test_invalidated_model_selected(self):\n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n    \n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n    \n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n    \n        self.widget.selected_vars[:] = self.data.domain[3:]\n        self.widget.model_selected.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n    \n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n>       self.widget.setup_plot.assert_called_once()\n\nr2e_tests/test_1.py:131: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\n_mock_self = <Mock id='139530810639120'>\n\n    def assert_called_once(_mock_self):\n        \"\"\"assert that the mock was called only once.\n        \"\"\"\n        self = _mock_self\n        if not self.call_count == 1:\n            msg = (\"Expected '%s' to have been called once. Called %s times.\" %\n                   (self._mock_name or 'mock', self.call_count))\n>           raise AssertionError(msg)\nE           AssertionError: Expected 'mock' to have been called once. Called 0 times.\n\n../../../../.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib/python3.7/unittest/mock.py:859: AssertionError\n________________________ TestOWRadviz.test_manual_move _________________________\n\nself = <r2e_tests.test_1.TestOWRadviz testMethod=test_manual_move>\n\n    def test_manual_move(self):\n>       super().test_manual_move()\n\nr2e_tests/test_1.py:86: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/widgets/tests/base.py:884: in test_manual_move\n    self.widget._manual_move(0, 1, 1)\nOrange/widgets/visualize/owradviz.py:415: in _manual_move\n    super()._manual_move(anchor_idx, np.cos(angle), np.sin(angle))\nOrange/widgets/visualize/utils/widget.py:728: in _manual_move\n    self.graph.update_coordinates()\nOrange/widgets/visualize/utils/component.py:60: in update_coordinates\n    super().update_coordinates()\nOrange/widgets/visualize/owscatterplotgraph.py:885: in update_coordinates\n    self._update_plot_coordinates(self.scatterplot_item, x, y)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Orange.widgets.visualize.owradviz.OWRadvizGraph object at 0x7ee707349690>\nplot = <Orange.widgets.visualize.owscatterplotgraph.ScatterPlotItem object at 0x7ee70736ae10>\nx = array([-0.20571715, -0.10116455, -0.28820332, -0.16653185, -0.094008  ,\n       -0.09659461, -0.06598064, -0.14803331, ...439238, -0.08518267,  0.0316945 ,  0.07265179,\n       -0.09168191,  0.11659768,  0.07767335, -0.0108475 , -0.0832802 ])\ny = array([ 2.98778047e-02,  5.40687996e-02, -2.39139559e-01,  2.05375732e-02,\n        6.89080239e-01,  7.43029470e-02,  1...5723e-01,  6.58325948e-01,  1.35779829e-01,\n        7.02271840e-01,  7.49812781e-01,  6.83453023e-01,  8.51848936e-02])\n\n    def _update_plot_coordinates(self, plot, x, y):\n        \"\"\"\n        Change the coordinates of points while keeping other properites.\n    \n        Asserts that the number of points stays the same.\n    \n        Note. Pyqtgraph does not offer a method for this: setting coordinates\n        invalidates other data. We therefore retrieve the data to set it\n        together with the coordinates. Pyqtgraph also does not offer a\n        (documented) method for retrieving the data, yet using\n        `plot.data[prop]` looks reasonably safe. The alternative, calling\n        update for every property would essentially reset the graph, which\n        can be time consuming.\n        \"\"\"\n        assert self.n_shown == len(x) == len(y)\n        data = dict(x=x, y=y)\n        for prop in ('pen', 'brush', 'size', 'symbol', 'data',\n                     'sourceRect', 'targetRect'):\n>           data[prop] = plot.data[prop]\nE           ValueError: no field of name targetRect\n\nOrange/widgets/visualize/owscatterplotgraph.py:855: ValueError\n__________________ TestOWLinearProjection.test_in_out_summary __________________\n\nself = <r2e_tests.test_2.TestOWLinearProjection testMethod=test_in_out_summary>\ntimeout = 5000\n\n    def test_in_out_summary(self, timeout=DEFAULT_TIMEOUT):\n        info = self.widget.info\n>       self.assertEqual(info._StateInfo__input_summary.brief, \"\")\nE       AssertionError: '-' != ''\nE       - -\nE       +\n\nOrange/widgets/tests/base.py:753: AssertionError\n____________ TestOWLinearProjection.test_invalidated_model_selected ____________\n\nself = <r2e_tests.test_2.TestOWLinearProjection testMethod=test_invalidated_model_selected>\n\n    def test_invalidated_model_selected(self):\n        model = self.widget.model_selected\n    \n        self.widget.setup_plot = Mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.setup_plot.assert_called_once()\n    \n        self.widget.setup_plot.reset_mock()\n        self.widget.selected_vars[:] = self.data.domain[2:3]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n    \n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data[:, 2:])\n        self.widget.setup_plot.assert_not_called()\n    \n        self.widget.selected_vars[:] = [self.data.domain[3]]\n        model.selection_changed.emit()\n        self.widget.setup_plot.assert_called_once()\n    \n        self.widget.setup_plot.reset_mock()\n        self.send_signal(self.widget.Inputs.data, self.data)\n>       self.widget.setup_plot.assert_called_once()\n\nr2e_tests/test_2.py:181: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\n_mock_self = <Mock id='139530370089680'>\n\n    def assert_called_once(_mock_self):\n        \"\"\"assert that the mock was called only once.\n        \"\"\"\n        self = _mock_self\n        if not self.call_count == 1:\n            msg = (\"Expected '%s' to have been called once. Called %s times.\" %\n                   (self._mock_name or 'mock', self.call_count))\n>           raise AssertionError(msg)\nE           AssertionError: Expected 'mock' to have been called once. Called 0 times.\n\n../../../../.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib/python3.7/unittest/mock.py:859: AssertionError\n___________________ TestOWLinearProjection.test_manual_move ____________________\n\nself = <r2e_tests.test_2.TestOWLinearProjection testMethod=test_manual_move>\n\n    def test_manual_move(self):\n        data = self.data.copy()\n        data[1, 0] = np.nan\n        nvalid, nsample = len(self.data) - 1, self.widget.SAMPLE_SIZE\n        self.send_signal(self.widget.Inputs.data, data)\n        self.widget.graph.select_by_indices(list(range(0, len(data), 10)))\n    \n        # remember state\n        selection = self.widget.graph.selection.copy()\n    \n        # simulate manual move\n        self.widget._manual_move_start()\n>       self.widget._manual_move(0, 1, 1)\n\nOrange/widgets/tests/base.py:884: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nOrange/widgets/visualize/utils/widget.py:728: in _manual_move\n    self.graph.update_coordinates()\nOrange/widgets/visualize/utils/component.py:60: in update_coordinates\n    super().update_coordinates()\nOrange/widgets/visualize/owscatterplotgraph.py:885: in update_coordinates\n    self._update_plot_coordinates(self.scatterplot_item, x, y)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Orange.widgets.visualize.owlinearprojection.OWLinProjGraph object at 0x7ee6f226e230>\nplot = <Orange.widgets.visualize.owscatterplotgraph.ScatterPlotItem object at 0x7ee6f2344c30>\nx = array([-0.24179717, -0.04735272, -0.10290828,  0.00820283, -0.10290828,\n        0.20264728,  0.20264728, -0.15846383, ...957494,  0.11931394,  0.00820283,  0.09153617,\n        0.20264728,  0.28598061,  0.11931394, -0.13068606,  0.20264728])\ny = array([-0.34093587, -0.07345539, -0.30157634, -0.16845087,  0.09354074,\n       -0.14706601, -0.01148143, -0.12890112, ...310907, -0.06285806,  0.28069217,  0.4111683 ,\n       -0.08916116,  0.45336738,  0.30046704,  0.21871821, -0.05632984])\n\n    def _update_plot_coordinates(self, plot, x, y):\n        \"\"\"\n        Change the coordinates of points while keeping other properites.\n    \n        Asserts that the number of points stays the same.\n    \n        Note. Pyqtgraph does not offer a method for this: setting coordinates\n        invalidates other data. We therefore retrieve the data to set it\n        together with the coordinates. Pyqtgraph also does not offer a\n        (documented) method for retrieving the data, yet using\n        `plot.data[prop]` looks reasonably safe. The alternative, calling\n        update for every property would essentially reset the graph, which\n        can be time consuming.\n        \"\"\"\n        assert self.n_shown == len(x) == len(y)\n        data = dict(x=x, y=y)\n        for prop in ('pen', 'brush', 'size', 'symbol', 'data',\n                     'sourceRect', 'targetRect'):\n>           data[prop] = plot.data[prop]\nE           ValueError: no field of name targetRect\n\nOrange/widgets/visualize/owscatterplotgraph.py:855: ValueError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_attr_label_metas\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_attr_models\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_class_density\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_datasets\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_default_attrs\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_discrete_attributes\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_dragging_tooltip\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_embedding_missing_values\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_handle_primitive_metas\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_hidden_effective_variables\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_image_export\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_invalidated_embedding\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_no_features\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_none_data\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_not_enough_instances\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_output_components\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_outputs\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_plot_once\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_saved_features\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_saved_selected_vars\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_saved_selection\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_send_report\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_setup_graph\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_sparse_data\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_subset_data_color\nPASSED r2e_tests/test_1.py::TestOWRadviz::test_visual_settings\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_attr_label_metas\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_attr_models\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_bad_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_btn_vizrank\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_buttons\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_class_density\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_data_no_cont_features\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_datasets\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_default_attrs\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_dragging_tooltip\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_embedding_missing_values\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_handle_primitive_metas\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_hidden_effective_variables\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_image_export\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_invalid_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_invalidated_embedding\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_migrate_settings_from_version_1\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_minimum_size\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_msg_base_class\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_nan_plot\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_no_data_for_lda\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_none_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_outputs\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_plot_once\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_radius\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_saved_selection\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_send_report\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_set_radius_no_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_setup_graph\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_sparse_data\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_subset_data_color\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_two_classes_dataset\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_unique_name\nPASSED r2e_tests/test_2.py::TestOWLinearProjection::test_visual_settings\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_continuous_class\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_discrete_class\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_image_export\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_minimum_size\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_msg_base_class\nPASSED r2e_tests/test_2.py::LinProjVizRankTests::test_set_attrs\nSKIPPED [2] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [2] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [2] .venv/lib/python3.7/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nERROR r2e_tests/test_2.py::WidgetTest::test_image_export - AttributeError: 'W...\nERROR r2e_tests/test_2.py::WidgetTest::test_minimum_size - AttributeError: 'W...\nERROR r2e_tests/test_2.py::WidgetTest::test_msg_base_class - AttributeError: ...\nFAILED r2e_tests/test_1.py::TestOWRadviz::test_btn_vizrank - TypeError: len()...\nFAILED r2e_tests/test_1.py::TestOWRadviz::test_in_out_summary - AssertionErro...\nFAILED r2e_tests/test_1.py::TestOWRadviz::test_invalidated_model_selected - A...\nFAILED r2e_tests/test_1.py::TestOWRadviz::test_manual_move - ValueError: no f...\nFAILED r2e_tests/test_2.py::TestOWLinearProjection::test_in_out_summary - Ass...\nFAILED r2e_tests/test_2.py::TestOWLinearProjection::test_invalidated_model_selected\nFAILED r2e_tests/test_2.py::TestOWLinearProjection::test_manual_move - ValueE...\n============== 7 failed, 68 passed, 6 skipped, 3 errors in 13.43s ==============\nWidgets left: 0    Max widgets: 10014 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/data/owselectcolumns.py Orange/widgets/settings.py Orange/widgets/visualize/tests/test_owlinearprojection.py Orange/widgets/visualize/tests/test_owradviz.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]

**Unexpected `setup_plot` Calls During Perfect Domain Context Matching**

When the domain context perfectly matches the provided attributes and metas, the `setup_plot` method is still being called. This leads to unexpected behavior and causes related tests to fail.

**Example Code:**

```python
def test_invalidated_model_selected(self):
    self.widget.setup_plot = Mock()
    self.send_signal(self.widget.Inputs.data, self.data)
    self.widget.setup_plot.assert_not_called()

    self.widget.setup_plot.reset_mock()
    self.widget.selected_vars[:] = self.data.domain[2:]
    self.widget.model_selected.selection_changed.emit()
    self.widget.setup_plot.assert_not_called()
```

**Expected Behavior:**

When the domain context matches the attributes and metas exactly, the `setup_plot` method should not be called, as no plot update is necessary.

**Actual Behavior:**

The `setup_plot` method is called despite the perfect match, causing tests that expect it not to be called to fail with an assertion error.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/widgets/settings.py
"""Widget Settings and Settings Handlers

Settings are used to declare widget attributes that persist through sessions.
When widget is removed or saved to a schema file, its settings are packed,
serialized and stored. When a new widget is created, values of attributes
marked as settings are read from disk. When schema is loaded, attribute values
are set to one stored in schema.

Each widget has its own SettingsHandler that takes care of serializing and
storing of settings and SettingProvider that is incharge of reading and
writing the setting values.

All widgets extending from OWWidget use SettingsHandler, unless they
declare otherwise. SettingsHandler ensures that setting attributes
are replaced with default (last used) setting values when the widget is
initialized and stored when the widget is removed.

Widgets with settings whose values depend on the widget inputs use
settings handlers based on ContextHandler. These handlers have two
additional methods, open_context and close_context.

open_context is called when widgets receives new data. It finds a suitable
context and sets the widget attributes to the values stored in context.
If no suitable context exists, a new one is created and values from widget
are copied to it.

close_context stores values that were last used on the widget to the context
so they can be used alter. It should be called before widget starts modifying
(initializing) the value of the setting attributes.
"""

# Overriden methods in these classes add arguments
# pylint: disable=arguments-differ,unused-argument,no-value-for-parameter

import copy
import itertools
import logging
import warnings

from orangewidget.settings import (
    Setting, SettingProvider, SettingsHandler, ContextSetting,
    ContextHandler, Context, IncompatibleContext, SettingsPrinter,
    rename_setting, widget_settings_dir
)
from orangewidget.settings import _apply_setting

from Orange.data import Domain, Variable
from Orange.util import OrangeDeprecationWarning
from Orange.widgets.utils import vartype

log = logging.getLogger(__name__)

__all__ = [
    # re-exported from orangewidget.settings
    "Setting", "SettingsHandler", "SettingProvider",
    "ContextSetting", "Context", "ContextHandler", "IncompatibleContext",
    "rename_setting", "widget_settings_dir",
    # defined here
    "DomainContextHandler", "PerfectDomainContextHandler",
    "ClassValuesContextHandler", "SettingsPrinter",
    "migrate_str_to_variable",
]


class DomainContextHandler(ContextHandler):
    """Context handler for widgets with settings that depend on
    the input dataset. Suitable settings are selected based on the
    data domain."""

    MATCH_VALUES_NONE, MATCH_VALUES_CLASS, MATCH_VALUES_ALL = range(3)

    def __init__(self, *, match_values=0, first_match=True, **kwargs):
        super().__init__()
        self.match_values = match_values
        self.first_match = first_match

        for name in kwargs:
            warnings.warn(
                "{} is not a valid parameter for DomainContextHandler"
                .format(name), OrangeDeprecationWarning
            )

    def encode_domain(self, domain):
        """
        domain: Orange.data.domain to encode
        return: dict mapping attribute name to type or list of values
                (based on the value of self.match_values attribute)
        """

        match = self.match_values
        encode = self.encode_variables
        if match == self.MATCH_VALUES_CLASS:
            attributes = encode(domain.attributes, False)
            attributes.update(encode(domain.class_vars, True))
        else:
            attributes = encode(domain.variables, match == self.MATCH_VALUES_ALL)

        metas = encode(domain.metas, match == self.MATCH_VALUES_ALL)

        return attributes, metas

    @staticmethod
    def encode_variables(attributes, encode_values):
        """Encode variables to a list mapping name to variable type
        or a list of values."""

        if not encode_values:
            return {v.name: vartype(v) for v in attributes}

        return {v.name: v.values if v.is_discrete else vartype(v)
                for v in attributes}

    def new_context(self, domain, attributes, metas):
        """Create a new context."""
        context = super().new_context()
        context.attributes = attributes
        context.metas = metas
        return context

    def open_context(self, widget, domain):
        if domain is None:
            return
        if not isinstance(domain, Domain):
            domain = domain.domain
        super().open_context(widget, domain, *self.encode_domain(domain))

    def filter_value(self, setting, data, domain, attrs, metas):
        value = data.get(setting.name, None)
        if isinstance(value, list):
            new_value = [item for item in value
                         if self.is_valid_item(setting, item, attrs, metas)]
            data[setting.name] = new_value
        elif isinstance(value, dict):
            new_value = {item: val for item, val in value.items()
                         if self.is_valid_item(setting, item, attrs, metas)}
            data[setting.name] = new_value
        elif self.is_encoded_var(value) \
                and not self._var_exists(setting, value, attrs, metas):
            del data[setting.name]

    @staticmethod
    def encode_variable(var):
        return var.name, 100 + vartype(var)

    @classmethod
    def encode_setting(cls, context, setting, value):
        if isinstance(value, list):
            if all(e is None or isinstance(e, Variable) for e in value) \
                    and any(e is not None for e in value):
                return ([None if e is None else cls.encode_variable(e)
                         for e in value],
                        -3)
            else:
                return copy.copy(value)

        elif isinstance(value, dict) \
                and all(isinstance(e, Variable) for e in value):
            return ({cls.encode_variable(e): val for e, val in value.items()},
                    -4)

        if isinstance(value, Variable):
            if isinstance(setting, ContextSetting):
                return cls.encode_variable(value)
            else:
                raise ValueError("Variables must be stored as ContextSettings; "
                                 f"change {setting.name} to ContextSetting.")

        return copy.copy(value), -2

    # backward compatibility, pylint: disable=keyword-arg-before-vararg
    def decode_setting(self, setting, value, domain=None, *args):
        def get_var(name):
            if domain is None:
                raise ValueError("Cannot decode variable without domain")
            return domain[name]

        if isinstance(value, tuple):
            data, dtype = value
            if dtype == -3:
                return[None if name_type is None else get_var(name_type[0])
                       for name_type in data]
            if dtype == -4:
                return {get_var(name): val for (name, _), val in data.items()}
            if dtype >= 100:
                return get_var(data)
            return value[0]
        else:
            return value

    @classmethod
    def _var_exists(cls, setting, value, attributes, metas):
        if not cls.is_encoded_var(value):
            return False

        attr_name, attr_type = value
        # attr_type used to be either 1-4 for variables stored as string
        # settings, and 101-104 for variables stored as variables. The former is
        # no longer supported, but we play it safe and still handle both here.
        attr_type %= 100
        return (not setting.exclude_attributes and
                attributes.get(attr_name, -1) == attr_type or
                not setting.exclude_metas and
                metas.get(attr_name, -1) == attr_type)

    def match(self, context, domain, attrs, metas):
        matches = []
        try:
            for setting, data, _ in \
                    self.provider.traverse_settings(data=context.values):
                if not isinstance(setting, ContextSetting):
                    continue
                value = data.get(setting.name, None)

                if isinstance(value, list):
                    matches.append(
                        self.match_list(setting, value, context, attrs, metas))
                # type check is a (not foolproof) check in case of a pair that
                # would, by conincidence, have -3 or -4 as the second element
                elif isinstance(value, tuple) and len(value) == 2 \
                       and (value[1] == -3 and isinstance(value[0], list)
                            or (value[1] == -4 and isinstance(value[0], dict))):
                    matches.append(self.match_list(setting, value[0], context,
                                                   attrs, metas))
                elif value is not None:
                    matches.append(
                        self.match_value(setting, value, attrs, metas))
        except IncompatibleContext:
            return self.NO_MATCH

        if self.first_match and matches and sum(m[0] for m in matches):
            return self.MATCH

        matches.append((0, 0))
        matched, available = [sum(m) for m in zip(*matches)]
        return matched / available if available else 0.1

    def match_list(self, setting, value, context, attrs, metas):
        """Match a list of values with the given context.
        returns a tuple containing number of matched and all values.
        """
        matched = 0
        for item in value:
            if self.is_valid_item(setting, item, attrs, metas):
                matched += 1
            elif setting.required == ContextSetting.REQUIRED:
                raise IncompatibleContext()
        return matched, len(value)

    def match_value(self, setting, value, attrs, metas):
        """Match a single value """
        if value[1] < 0:
            return 0, 0

        if self._var_exists(setting, value, attrs, metas):
            return 1, 1
        elif setting.required == setting.OPTIONAL:
            return 0, 1
        else:
            raise IncompatibleContext()

    def is_valid_item(self, setting, item, attrs, metas):
        """Return True if given item can be used with attrs and metas

        Subclasses can override this method to checks data in alternative
        representations.
        """
        if not isinstance(item, tuple):
            return True
        return self._var_exists(setting, item, attrs, metas)

    @staticmethod
    def is_encoded_var(value):
        return isinstance(value, tuple) \
            and len(value) == 2 \
            and isinstance(value[0], str) and isinstance(value[1], int) \
            and value[1] >= 0

class ClassValuesContextHandler(ContextHandler):
    """Context handler used for widgets that work with
    a single discrete variable"""

    def open_context(self, widget, classes):
        if isinstance(classes, Variable):
            if classes.is_discrete:
                classes = classes.values
            else:
                classes = None

        super().open_context(widget, classes)

    def new_context(self, classes):
        context = super().new_context()
        context.classes = classes
        return context

    def match(self, context, classes):
        if isinstance(classes, Variable) and classes.is_continuous:
            return (self.PERFECT_MATCH if context.classes is None
                    else self.NO_MATCH)
        else:
            # variable.values used to be a list, and so were context.classes
            # cast to tuple for compatibility with past contexts
            if context.classes is not None and tuple(context.classes) == classes:
                return self.PERFECT_MATCH
            else:
                return self.NO_MATCH


class PerfectDomainContextHandler(DomainContextHandler):
    """Context handler that matches a context only when
    the same domain is available.

    It uses a different encoding than the DomainContextHandler.
    """

    def new_context(self, domain, attributes, class_vars, metas):
        """Same as DomainContextHandler, but also store class_vars"""
        context = super().new_context(domain, attributes, metas)
        context.class_vars = class_vars
        return context

    def clone_context(self, old_context, *args):
        """Copy of context is always valid, since widgets are using
        the same domain."""
        context = self.new_context(*args)
        context.values = copy.deepcopy(old_context.values)
        return context

    def encode_domain(self, domain):
        """Encode domain into tuples (name, type)
        A tuple is returned for each of attributes, class_vars and metas.
        """

        if self.match_values == self.MATCH_VALUES_ALL:
            def _encode(attrs):
                return tuple((v.name, list(v.values) if v.is_discrete else vartype(v))
                             for v in attrs)
        else:
            def _encode(attrs):
                return tuple((v.name, vartype(v)) for v in attrs)
        return (_encode(domain.attributes),
                _encode(domain.class_vars),
                _encode(domain.metas))

    def match(self, context, domain, attributes, class_vars, metas):
        """Context only matches when domains are the same"""

        return (self.PERFECT_MATCH
                if (context.attributes == attributes and
                    context.class_vars == class_vars and
                    context.metas == metas)
                else self.NO_MATCH)

    def encode_setting(self, context, setting, value):
        """Same as is domain context handler, but handles separately stored
        class_vars."""

        if isinstance(setting, ContextSetting) and isinstance(value, str):

            def _candidate_variables():
                if not setting.exclude_attributes:
                    yield from itertools.chain(context.attributes,
                                               context.class_vars)
                if not setting.exclude_metas:
                    yield from context.metas

            for aname, atype in _candidate_variables():
                if aname == value:
                    return value, atype

            return value, -1
        else:
            return super().encode_setting(context, setting, value)


def migrate_str_to_variable(settings, names=None, none_placeholder=None):
    """
    Change variables stored as `(str, int)` to `(Variable, int)`.

    Args:
        settings (Context): context that is being migrated
        names (sequence): names of settings to be migrated. If omitted,
            all settings with values `(str, int)` are migrated.
    """
    def _fix(name):
        var, vtype = settings.values[name]
        if 0 <= vtype <= 100:
            settings.values[name] = (var, 100 + vtype)
        elif var == none_placeholder and vtype == -2:
            settings.values[name] = None

    if names is None:
        for name, setting in settings.values.items():
            if DomainContextHandler.is_encoded_var(setting):
                _fix(name)
    elif isinstance(names, str):
        _fix(names)
    else:
        for name in names:
            _fix(name)

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
[ISSUE]

**Unexpected `setup_plot` Calls During Perfect Domain Context Matching**

When the domain context perfectly matches the provided attributes and metas, the `setup_plot` method is still being called. This leads to unexpected behavior and causes related tests to fail.

**Example Code:**

```python
def test_invalidated_model_selected(self):
    self.widget.setup_plot = Mock()
    self.send_signal(self.widget.Inputs.data, self.data)
    self.widget.setup_plot.assert_not_called()

    self.widget.setup_plot.reset_mock()
    self.widget.selected_vars[:] = self.data.domain[2:]
    self.widget.model_selected.selection_changed.emit()
    self.widget.setup_plot.assert_not_called()
```

**Expected Behavior:**

When the domain context matches the attributes and metas exactly, the `setup_plot` method should not be called, as no plot update is necessary.

**Actual Behavior:**

The `setup_plot` method is called despite the perfect match, causing tests that expect it not to be called to fail with an assertion error.

[/ISSUE]
{
    "TestOWRadviz.test_attr_label_metas": "PASSED",
    "TestOWRadviz.test_attr_models": "PASSED",
    "TestOWRadviz.test_class_density": "PASSED",
    "TestOWRadviz.test_datasets": "PASSED",
    "TestOWRadviz.test_default_attrs": "PASSED",
    "TestOWRadviz.test_discrete_attributes": "PASSED",
    "TestOWRadviz.test_dragging_tooltip": "PASSED",
    "TestOWRadviz.test_embedding_missing_values": "PASSED",
    "TestOWRadviz.test_handle_primitive_metas": "PASSED",
    "TestOWRadviz.test_hidden_effective_variables": "PASSED",
    "TestOWRadviz.test_image_export": "PASSED",
    "TestOWRadviz.test_invalidated_embedding": "PASSED",
    "TestOWRadviz.test_invalidated_model_selected": "PASSED",
    "TestOWRadviz.test_minimum_size": "PASSED",
    "TestOWRadviz.test_msg_base_class": "PASSED",
    "TestOWRadviz.test_no_features": "PASSED",
    "TestOWRadviz.test_none_data": "PASSED",
    "TestOWRadviz.test_not_enough_instances": "PASSED",
    "TestOWRadviz.test_output_components": "PASSED",
    "TestOWRadviz.test_outputs": "PASSED",
    "TestOWRadviz.test_plot_once": "PASSED",
    "TestOWRadviz.test_saved_features": "PASSED",
    "TestOWRadviz.test_saved_selected_vars": "PASSED",
    "TestOWRadviz.test_saved_selection": "PASSED",
    "TestOWRadviz.test_send_report": "PASSED",
    "TestOWRadviz.test_setup_graph": "PASSED",
    "TestOWRadviz.test_sparse_data": "PASSED",
    "TestOWRadviz.test_subset_data_color": "PASSED",
    "TestOWRadviz.test_visual_settings": "PASSED",
    "TestOWLinearProjection.test_attr_label_metas": "PASSED",
    "TestOWLinearProjection.test_attr_models": "PASSED",
    "TestOWLinearProjection.test_bad_data": "PASSED",
    "TestOWLinearProjection.test_btn_vizrank": "PASSED",
    "TestOWLinearProjection.test_buttons": "PASSED",
    "TestOWLinearProjection.test_class_density": "PASSED",
    "TestOWLinearProjection.test_data_no_cont_features": "PASSED",
    "TestOWLinearProjection.test_datasets": "PASSED",
    "TestOWLinearProjection.test_default_attrs": "PASSED",
    "TestOWLinearProjection.test_dragging_tooltip": "PASSED",
    "TestOWLinearProjection.test_embedding_missing_values": "PASSED",
    "TestOWLinearProjection.test_handle_primitive_metas": "PASSED",
    "TestOWLinearProjection.test_hidden_effective_variables": "PASSED",
    "TestOWLinearProjection.test_image_export": "PASSED",
    "TestOWLinearProjection.test_invalid_data": "PASSED",
    "TestOWLinearProjection.test_invalidated_embedding": "PASSED",
    "TestOWLinearProjection.test_invalidated_model_selected": "PASSED",
    "TestOWLinearProjection.test_migrate_settings_from_version_1": "PASSED",
    "TestOWLinearProjection.test_minimum_size": "PASSED",
    "TestOWLinearProjection.test_msg_base_class": "PASSED",
    "TestOWLinearProjection.test_nan_plot": "PASSED",
    "TestOWLinearProjection.test_no_data_for_lda": "PASSED",
    "TestOWLinearProjection.test_none_data": "PASSED",
    "TestOWLinearProjection.test_outputs": "PASSED",
    "TestOWLinearProjection.test_plot_once": "PASSED",
    "TestOWLinearProjection.test_radius": "PASSED",
    "TestOWLinearProjection.test_saved_selection": "PASSED",
    "TestOWLinearProjection.test_send_report": "PASSED",
    "TestOWLinearProjection.test_set_radius_no_data": "PASSED",
    "TestOWLinearProjection.test_setup_graph": "PASSED",
    "TestOWLinearProjection.test_sparse_data": "PASSED",
    "TestOWLinearProjection.test_subset_data_color": "PASSED",
    "TestOWLinearProjection.test_two_classes_dataset": "PASSED",
    "TestOWLinearProjection.test_unique_name": "PASSED",
    "TestOWLinearProjection.test_visual_settings": "PASSED",
    "LinProjVizRankTests.test_continuous_class": "PASSED",
    "LinProjVizRankTests.test_discrete_class": "PASSED",
    "LinProjVizRankTests.test_image_export": "PASSED",
    "LinProjVizRankTests.test_minimum_size": "PASSED",
    "LinProjVizRankTests.test_msg_base_class": "PASSED",
    "LinProjVizRankTests.test_set_attrs": "PASSED",
    "WidgetTest.test_image_export": "ERROR",
    "WidgetTest.test_minimum_size": "ERROR",
    "WidgetTest.test_msg_base_class": "ERROR",
    "TestOWRadviz.test_btn_vizrank": "FAILED",
    "TestOWRadviz.test_in_out_summary": "FAILED",
    "TestOWRadviz.test_manual_move": "FAILED",
    "TestOWLinearProjection.test_in_out_summary": "FAILED",
    "TestOWLinearProjection.test_manual_move": "FAILED"
}
diff --git a/Orange/widgets/data/owselectcolumns.py b/Orange/widgets/data/owselectcolumns.py
index 7bd8d5837..4e7abd40c 100644
--- a/Orange/widgets/data/owselectcolumns.py
+++ b/Orange/widgets/data/owselectcolumns.py
@@ -116,6 +116,9 @@ class SelectAttributesDomainContextHandler(DomainContextHandler):
         return decoded
 
     def match(self, context, domain, attrs, metas):
+        if context.attributes == attrs and context.metas == metas:
+            return self.PERFECT_MATCH
+
         if not "domain_role_hints" in context.values:
             return self.NO_MATCH
 
diff --git a/Orange/widgets/settings.py b/Orange/widgets/settings.py
index 14fa183d1..3bbe31eb2 100644
--- a/Orange/widgets/settings.py
+++ b/Orange/widgets/settings.py
@@ -203,6 +203,9 @@ class DomainContextHandler(ContextHandler):
                 metas.get(attr_name, -1) == attr_type)
 
     def match(self, context, domain, attrs, metas):
+        if context.attributes == attrs and context.metas == metas:
+            return self.PERFECT_MATCH
+
         matches = []
         try:
             for setting, data, _ in \

{"Orange/widgets/settings.py": "\"\"\"Widget Settings and Settings Handlers\n\nSettings are used to declare widget attributes that persist through sessions.\nWhen widget is removed or saved to a schema file, its settings are packed,\nserialized and stored. When a new widget is created, values of attributes\nmarked as settings are read from disk. When schema is loaded, attribute values\nare set to one stored in schema.\n\nEach widget has its own SettingsHandler that takes care of serializing and\nstoring of settings and SettingProvider that is incharge of reading and\nwriting the setting values.\n\nAll widgets extending from OWWidget use SettingsHandler, unless they\ndeclare otherwise. SettingsHandler ensures that setting attributes\nare replaced with default (last used) setting values when the widget is\ninitialized and stored when the widget is removed.\n\nWidgets with settings whose values depend on the widget inputs use\nsettings handlers based on ContextHandler. These handlers have two\nadditional methods, open_context and close_context.\n\nopen_context is called when widgets receives new data. It finds a suitable\ncontext and sets the widget attributes to the values stored in context.\nIf no suitable context exists, a new one is created and values from widget\nare copied to it.\n\nclose_context stores values that were last used on the widget to the context\nso they can be used alter. It should be called before widget starts modifying\n(initializing) the value of the setting attributes.\n\"\"\"\n\n# Overriden methods in these classes add arguments\n# pylint: disable=arguments-differ,unused-argument,no-value-for-parameter\n\nimport copy\nimport itertools\nimport logging\nimport warnings\n\nfrom orangewidget.settings import (\n    Setting, SettingProvider, SettingsHandler, ContextSetting,\n    ContextHandler, Context, IncompatibleContext, SettingsPrinter,\n    rename_setting, widget_settings_dir\n)\nfrom orangewidget.settings import _apply_setting\n\nfrom Orange.data import Domain, Variable\nfrom Orange.util import OrangeDeprecationWarning\nfrom Orange.widgets.utils import vartype\n\nlog = logging.getLogger(__name__)\n\n__all__ = [\n    # re-exported from orangewidget.settings\n    \"Setting\", \"SettingsHandler\", \"SettingProvider\",\n    \"ContextSetting\", \"Context\", \"ContextHandler\", \"IncompatibleContext\",\n    \"rename_setting\", \"widget_settings_dir\",\n    # defined here\n    \"DomainContextHandler\", \"PerfectDomainContextHandler\",\n    \"ClassValuesContextHandler\", \"SettingsPrinter\",\n    \"migrate_str_to_variable\",\n]\n\n\nclass DomainContextHandler(ContextHandler):\n    \"\"\"Context handler for widgets with settings that depend on\n    the input dataset. Suitable settings are selected based on the\n    data domain.\"\"\"\n\n    MATCH_VALUES_NONE, MATCH_VALUES_CLASS, MATCH_VALUES_ALL = range(3)\n\n    def __init__(self, *, match_values=0, first_match=True, **kwargs):\n        super().__init__()\n        self.match_values = match_values\n        self.first_match = first_match\n\n        for name in kwargs:\n            warnings.warn(\n                \"{} is not a valid parameter for DomainContextHandler\"\n                .format(name), OrangeDeprecationWarning\n            )\n\n    def encode_domain(self, domain):\n        \"\"\"\n        domain: Orange.data.domain to encode\n        return: dict mapping attribute name to type or list of values\n                (based on the value of self.match_values attribute)\n        \"\"\"\n\n        match = self.match_values\n        encode = self.encode_variables\n        if match == self.MATCH_VALUES_CLASS:\n            attributes = encode(domain.attributes, False)\n            attributes.update(encode(domain.class_vars, True))\n        else:\n            attributes = encode(domain.variables, match == self.MATCH_VALUES_ALL)\n\n        metas = encode(domain.metas, match == self.MATCH_VALUES_ALL)\n\n        return attributes, metas\n\n    @staticmethod\n    def encode_variables(attributes, encode_values):\n        \"\"\"Encode variables to a list mapping name to variable type\n        or a list of values.\"\"\"\n\n        if not encode_values:\n            return {v.name: vartype(v) for v in attributes}\n\n        return {v.name: v.values if v.is_discrete else vartype(v)\n                for v in attributes}\n\n    def new_context(self, domain, attributes, metas):\n        \"\"\"Create a new context.\"\"\"\n        context = super().new_context()\n        context.attributes = attributes\n        context.metas = metas\n        return context\n\n    def open_context(self, widget, domain):\n        if domain is None:\n            return\n        if not isinstance(domain, Domain):\n            domain = domain.domain\n        super().open_context(widget, domain, *self.encode_domain(domain))\n\n    def filter_value(self, setting, data, domain, attrs, metas):\n        value = data.get(setting.name, None)\n        if isinstance(value, list):\n            new_value = [item for item in value\n                         if self.is_valid_item(setting, item, attrs, metas)]\n            data[setting.name] = new_value\n        elif isinstance(value, dict):\n            new_value = {item: val for item, val in value.items()\n                         if self.is_valid_item(setting, item, attrs, metas)}\n            data[setting.name] = new_value\n        elif self.is_encoded_var(value) \\\n                and not self._var_exists(setting, value, attrs, metas):\n            del data[setting.name]\n\n    @staticmethod\n    def encode_variable(var):\n        return var.name, 100 + vartype(var)\n\n    @classmethod\n    def encode_setting(cls, context, setting, value):\n        if isinstance(value, list):\n            if all(e is None or isinstance(e, Variable) for e in value) \\\n                    and any(e is not None for e in value):\n                return ([None if e is None else cls.encode_variable(e)\n                         for e in value],\n                        -3)\n            else:\n                return copy.copy(value)\n\n        elif isinstance(value, dict) \\\n                and all(isinstance(e, Variable) for e in value):\n            return ({cls.encode_variable(e): val for e, val in value.items()},\n                    -4)\n\n        if isinstance(value, Variable):\n            if isinstance(setting, ContextSetting):\n                return cls.encode_variable(value)\n            else:\n                raise ValueError(\"Variables must be stored as ContextSettings; \"\n                                 f\"change {setting.name} to ContextSetting.\")\n\n        return copy.copy(value), -2\n\n    # backward compatibility, pylint: disable=keyword-arg-before-vararg\n    def decode_setting(self, setting, value, domain=None, *args):\n        def get_var(name):\n            if domain is None:\n                raise ValueError(\"Cannot decode variable without domain\")\n            return domain[name]\n\n        if isinstance(value, tuple):\n            data, dtype = value\n            if dtype == -3:\n                return[None if name_type is None else get_var(name_type[0])\n                       for name_type in data]\n            if dtype == -4:\n                return {get_var(name): val for (name, _), val in data.items()}\n            if dtype >= 100:\n                return get_var(data)\n            return value[0]\n        else:\n            return value\n\n    @classmethod\n    def _var_exists(cls, setting, value, attributes, metas):\n        if not cls.is_encoded_var(value):\n            return False\n\n        attr_name, attr_type = value\n        # attr_type used to be either 1-4 for variables stored as string\n        # settings, and 101-104 for variables stored as variables. The former is\n        # no longer supported, but we play it safe and still handle both here.\n        attr_type %= 100\n        return (not setting.exclude_attributes and\n                attributes.get(attr_name, -1) == attr_type or\n                not setting.exclude_metas and\n                metas.get(attr_name, -1) == attr_type)\n\n    def match(self, context, domain, attrs, metas):\n        matches = []\n        try:\n            for setting, data, _ in \\\n                    self.provider.traverse_settings(data=context.values):\n                if not isinstance(setting, ContextSetting):\n                    continue\n                value = data.get(setting.name, None)\n\n                if isinstance(value, list):\n                    matches.append(\n                        self.match_list(setting, value, context, attrs, metas))\n                # type check is a (not foolproof) check in case of a pair that\n                # would, by conincidence, have -3 or -4 as the second element\n                elif isinstance(value, tuple) and len(value) == 2 \\\n                       and (value[1] == -3 and isinstance(value[0], list)\n                            or (value[1] == -4 and isinstance(value[0], dict))):\n                    matches.append(self.match_list(setting, value[0], context,\n                                                   attrs, metas))\n                elif value is not None:\n                    matches.append(\n                        self.match_value(setting, value, attrs, metas))\n        except IncompatibleContext:\n            return self.NO_MATCH\n\n        if self.first_match and matches and sum(m[0] for m in matches):\n            return self.MATCH\n\n        matches.append((0, 0))\n        matched, available = [sum(m) for m in zip(*matches)]\n        return matched / available if available else 0.1\n\n    def match_list(self, setting, value, context, attrs, metas):\n        \"\"\"Match a list of values with the given context.\n        returns a tuple containing number of matched and all values.\n        \"\"\"\n        matched = 0\n        for item in value:\n            if self.is_valid_item(setting, item, attrs, metas):\n                matched += 1\n            elif setting.required == ContextSetting.REQUIRED:\n                raise IncompatibleContext()\n        return matched, len(value)\n\n    def match_value(self, setting, value, attrs, metas):\n        \"\"\"Match a single value \"\"\"\n        if value[1] < 0:\n            return 0, 0\n\n        if self._var_exists(setting, value, attrs, metas):\n            return 1, 1\n        elif setting.required == setting.OPTIONAL:\n            return 0, 1\n        else:\n            raise IncompatibleContext()\n\n    def is_valid_item(self, setting, item, attrs, metas):\n        \"\"\"Return True if given item can be used with attrs and metas\n\n        Subclasses can override this method to checks data in alternative\n        representations.\n        \"\"\"\n        if not isinstance(item, tuple):\n            return True\n        return self._var_exists(setting, item, attrs, metas)\n\n    @staticmethod\n    def is_encoded_var(value):\n        return isinstance(value, tuple) \\\n            and len(value) == 2 \\\n            and isinstance(value[0], str) and isinstance(value[1], int) \\\n            and value[1] >= 0\n\nclass ClassValuesContextHandler(ContextHandler):\n    \"\"\"Context handler used for widgets that work with\n    a single discrete variable\"\"\"\n\n    def open_context(self, widget, classes):\n        if isinstance(classes, Variable):\n            if classes.is_discrete:\n                classes = classes.values\n            else:\n                classes = None\n\n        super().open_context(widget, classes)\n\n    def new_context(self, classes):\n        context = super().new_context()\n        context.classes = classes\n        return context\n\n    def match(self, context, classes):\n        if isinstance(classes, Variable) and classes.is_continuous:\n            return (self.PERFECT_MATCH if context.classes is None\n                    else self.NO_MATCH)\n        else:\n            # variable.values used to be a list, and so were context.classes\n            # cast to tuple for compatibility with past contexts\n            if context.classes is not None and tuple(context.classes) == classes:\n                return self.PERFECT_MATCH\n            else:\n                return self.NO_MATCH\n\n\nclass PerfectDomainContextHandler(DomainContextHandler):\n    \"\"\"Context handler that matches a context only when\n    the same domain is available.\n\n    It uses a different encoding than the DomainContextHandler.\n    \"\"\"\n\n    def new_context(self, domain, attributes, class_vars, metas):\n        \"\"\"Same as DomainContextHandler, but also store class_vars\"\"\"\n        context = super().new_context(domain, attributes, metas)\n        context.class_vars = class_vars\n        return context\n\n    def clone_context(self, old_context, *args):\n        \"\"\"Copy of context is always valid, since widgets are using\n        the same domain.\"\"\"\n        context = self.new_context(*args)\n        context.values = copy.deepcopy(old_context.values)\n        return context\n\n    def encode_domain(self, domain):\n        \"\"\"Encode domain into tuples (name, type)\n        A tuple is returned for each of attributes, class_vars and metas.\n        \"\"\"\n\n        if self.match_values == self.MATCH_VALUES_ALL:\n            def _encode(attrs):\n                return tuple((v.name, list(v.values) if v.is_discrete else vartype(v))\n                             for v in attrs)\n        else:\n            def _encode(attrs):\n                return tuple((v.name, vartype(v)) for v in attrs)\n        return (_encode(domain.attributes),\n                _encode(domain.class_vars),\n                _encode(domain.metas))\n\n    def match(self, context, domain, attributes, class_vars, metas):\n        \"\"\"Context only matches when domains are the same\"\"\"\n\n        return (self.PERFECT_MATCH\n                if (context.attributes == attributes and\n                    context.class_vars == class_vars and\n                    context.metas == metas)\n                else self.NO_MATCH)\n\n    def encode_setting(self, context, setting, value):\n        \"\"\"Same as is domain context handler, but handles separately stored\n        class_vars.\"\"\"\n\n        if isinstance(setting, ContextSetting) and isinstance(value, str):\n\n            def _candidate_variables():\n                if not setting.exclude_attributes:\n                    yield from itertools.chain(context.attributes,\n                                               context.class_vars)\n                if not setting.exclude_metas:\n                    yield from context.metas\n\n            for aname, atype in _candidate_variables():\n                if aname == value:\n                    return value, atype\n\n            return value, -1\n        else:\n            return super().encode_setting(context, setting, value)\n\n\ndef migrate_str_to_variable(settings, names=None, none_placeholder=None):\n    \"\"\"\n    Change variables stored as `(str, int)` to `(Variable, int)`.\n\n    Args:\n        settings (Context): context that is being migrated\n        names (sequence): names of settings to be migrated. If omitted,\n            all settings with values `(str, int)` are migrated.\n    \"\"\"\n    def _fix(name):\n        var, vtype = settings.values[name]\n        if 0 <= vtype <= 100:\n            settings.values[name] = (var, 100 + vtype)\n        elif var == none_placeholder and vtype == -2:\n            settings.values[name] = None\n\n    if names is None:\n        for name, setting in settings.values.items():\n            if DomainContextHandler.is_encoded_var(setting):\n                _fix(name)\n    elif isinstance(names, str):\n        _fix(names)\n    else:\n        for name in names:\n            _fix(name)\n"}
A user will ask you to solve a task. You should first draft your thinking process (inner monologue). Then, generate the solution.

Your response format must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate a correct solution.
</think>
<solution>
Final solution presented to the user.
</solution>
system
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]

**Unexpected `setup_plot` Calls During Perfect Domain Context Matching**

When the domain context perfectly matches the provided attributes and metas, the `setup_plot` method is still being called. This leads to unexpected behavior and causes related tests to fail.

**Example Code:**

```python
def test_invalidated_model_selected(self):
    self.widget.setup_plot = Mock()
    self.send_signal(self.widget.Inputs.data, self.data)
    self.widget.setup_plot.assert_not_called()

    self.widget.setup_plot.reset_mock()
    self.widget.selected_vars[:] = self.data.domain[2:]
    self.widget.model_selected.selection_changed.emit()
    self.widget.setup_plot.assert_not_called()
```

**Expected Behavior:**

When the domain context matches the attributes and metas exactly, the `setup_plot` method should not be called, as no plot update is necessary.

**Actual Behavior:**

The `setup_plot` method is called despite the perfect match, causing tests that expect it not to be called to fail with an assertion error.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/widgets/settings.py
"""Widget Settings and Settings Handlers

Settings are used to declare widget attributes that persist through sessions.
When widget is removed or saved to a schema file, its settings are packed,
serialized and stored. When a new widget is created, values of attributes
marked as settings are read from disk. When schema is loaded, attribute values
are set to one stored in schema.

Each widget has its own SettingsHandler that takes care of serializing and
storing of settings and SettingProvider that is incharge of reading and
writing the setting values.

All widgets extending from OWWidget use SettingsHandler, unless they
declare otherwise. SettingsHandler ensures that setting attributes
are replaced with default (last used) setting values when the widget is
initialized and stored when the widget is removed.

Widgets with settings whose values depend on the widget inputs use
settings handlers based on ContextHandler. These handlers have two
additional methods, open_context and close_context.

open_context is called when widgets receives new data. It finds a suitable
context and sets the widget attributes to the values stored in context.
If no suitable context exists, a new one is created and values from widget
are copied to it.

close_context stores values that were last used on the widget to the context
so they can be used alter. It should be called before widget starts modifying
(initializing) the value of the setting attributes.
"""

# Overriden methods in these classes add arguments
# pylint: disable=arguments-differ,unused-argument,no-value-for-parameter

import copy
import itertools
import logging
import warnings

from orangewidget.settings import (
    Setting, SettingProvider, SettingsHandler, ContextSetting,
    ContextHandler, Context, IncompatibleContext, SettingsPrinter,
    rename_setting, widget_settings_dir
)
from orangewidget.settings import _apply_setting

from Orange.data import Domain, Variable
from Orange.util import OrangeDeprecationWarning
from Orange.widgets.utils import vartype

log = logging.getLogger(__name__)

__all__ = [
    # re-exported from orangewidget.settings
    "Setting", "SettingsHandler", "SettingProvider",
    "ContextSetting", "Context", "ContextHandler", "IncompatibleContext",
    "rename_setting", "widget_settings_dir",
    # defined here
    "DomainContextHandler", "PerfectDomainContextHandler",
    "ClassValuesContextHandler", "SettingsPrinter",
    "migrate_str_to_variable",
]


class DomainContextHandler(ContextHandler):
    """Context handler for widgets with settings that depend on
    the input dataset. Suitable settings are selected based on the
    data domain."""

    MATCH_VALUES_NONE, MATCH_VALUES_CLASS, MATCH_VALUES_ALL = range(3)

    def __init__(self, *, match_values=0, first_match=True, **kwargs):
        super().__init__()
        self.match_values = match_values
        self.first_match = first_match

        for name in kwargs:
            warnings.warn(
                "{} is not a valid parameter for DomainContextHandler"
                .format(name), OrangeDeprecationWarning
            )

    def encode_domain(self, domain):
        """
        domain: Orange.data.domain to encode
        return: dict mapping attribute name to type or list of values
                (based on the value of self.match_values attribute)
        """

        match = self.match_values
        encode = self.encode_variables
        if match == self.MATCH_VALUES_CLASS:
            attributes = encode(domain.attributes, False)
            attributes.update(encode(domain.class_vars, True))
        else:
            attributes = encode(domain.variables, match == self.MATCH_VALUES_ALL)

        metas = encode(domain.metas, match == self.MATCH_VALUES_ALL)

        return attributes, metas

    @staticmethod
    def encode_variables(attributes, encode_values):
        """Encode variables to a list mapping name to variable type
        or a list of values."""

        if not encode_values:
            return {v.name: vartype(v) for v in attributes}

        return {v.name: v.values if v.is_discrete else vartype(v)
                for v in attributes}

    def new_context(self, domain, attributes, metas):
        """Create a new context."""
        context = super().new_context()
        context.attributes = attributes
        context.metas = metas
        return context

    def open_context(self, widget, domain):
        if domain is None:
            return
        if not isinstance(domain, Domain):
            domain = domain.domain
        super().open_context(widget, domain, *self.encode_domain(domain))

    def filter_value(self, setting, data, domain, attrs, metas):
        value = data.get(setting.name, None)
        if isinstance(value, list):
            new_value = [item for item in value
                         if self.is_valid_item(setting, item, attrs, metas)]
            data[setting.name] = new_value
        elif isinstance(value, dict):
            new_value = {item: val for item, val in value.items()
                         if self.is_valid_item(setting, item, attrs, metas)}
            data[setting.name] = new_value
        elif self.is_encoded_var(value) \
                and not self._var_exists(setting, value, attrs, metas):
            del data[setting.name]

    @staticmethod
    def encode_variable(var):
        return var.name, 100 + vartype(var)

    @classmethod
    def encode_setting(cls, context, setting, value):
        if isinstance(value, list):
            if all(e is None or isinstance(e, Variable) for e in value) \
                    and any(e is not None for e in value):
                return ([None if e is None else cls.encode_variable(e)
                         for e in value],
                        -3)
            else:
                return copy.copy(value)

        elif isinstance(value, dict) \
                and all(isinstance(e, Variable) for e in value):
            return ({cls.encode_variable(e): val for e, val in value.items()},
                    -4)

        if isinstance(value, Variable):
            if isinstance(setting, ContextSetting):
                return cls.encode_variable(value)
            else:
                raise ValueError("Variables must be stored as ContextSettings; "
                                 f"change {setting.name} to ContextSetting.")

        return copy.copy(value), -2

    # backward compatibility, pylint: disable=keyword-arg-before-vararg
    def decode_setting(self, setting, value, domain=None, *args):
        def get_var(name):
            if domain is None:
                raise ValueError("Cannot decode variable without domain")
            return domain[name]

        if isinstance(value, tuple):
            data, dtype = value
            if dtype == -3:
                return[None if name_type is None else get_var(name_type[0])
                       for name_type in data]
            if dtype == -4:
                return {get_var(name): val for (name, _), val in data.items()}
            if dtype >= 100:
                return get_var(data)
            return value[0]
        else:
            return value

    @classmethod
    def _var_exists(cls, setting, value, attributes, metas):
        if not cls.is_encoded_var(value):
            return False

        attr_name, attr_type = value
        # attr_type used to be either 1-4 for variables stored as string
        # settings, and 101-104 for variables stored as variables. The former is
        # no longer supported, but we play it safe and still handle both here.
        attr_type %= 100
        return (not setting.exclude_attributes and
                attributes.get(attr_name, -1) == attr_type or
                not setting.exclude_metas and
                metas.get(attr_name, -1) == attr_type)

    def match(self, context, domain, attrs, metas):
        matches = []
        try:
            for setting, data, _ in \
                    self.provider.traverse_settings(data=context.values):
                if not isinstance(setting, ContextSetting):
                    continue
                value = data.get(setting.name, None)

                if isinstance(value, list):
                    matches.append(
                        self.match_list(setting, value, context, attrs, metas))
                # type check is a (not foolproof) check in case of a pair that
                # would, by conincidence, have -3 or -4 as the second element
                elif isinstance(value, tuple) and len(value) == 2 \
                       and (value[1] == -3 and isinstance(value[0], list)
                            or (value[1] == -4 and isinstance(value[0], dict))):
                    matches.append(self.match_list(setting, value[0], context,
                                                   attrs, metas))
                elif value is not None:
                    matches.append(
                        self.match_value(setting, value, attrs, metas))
        except IncompatibleContext:
            return self.NO_MATCH

        if self.first_match and matches and sum(m[0] for m in matches):
            return self.MATCH

        matches.append((0, 0))
        matched, available = [sum(m) for m in zip(*matches)]
        return matched / available if available else 0.1

    def match_list(self, setting, value, context, attrs, metas):
        """Match a list of values with the given context.
        returns a tuple containing number of matched and all values.
        """
        matched = 0
        for item in value:
            if self.is_valid_item(setting, item, attrs, metas):
                matched += 1
            elif setting.required == ContextSetting.REQUIRED:
                raise IncompatibleContext()
        return matched, len(value)

    def match_value(self, setting, value, attrs, metas):
        """Match a single value """
        if value[1] < 0:
            return 0, 0

        if self._var_exists(setting, value, attrs, metas):
            return 1, 1
        elif setting.required == setting.OPTIONAL:
            return 0, 1
        else:
            raise IncompatibleContext()

    def is_valid_item(self, setting, item, attrs, metas):
        """Return True if given item can be used with attrs and metas

        Subclasses can override this method to checks data in alternative
        representations.
        """
        if not isinstance(item, tuple):
            return True
        return self._var_exists(setting, item, attrs, metas)

    @staticmethod
    def is_encoded_var(value):
        return isinstance(value, tuple) \
            and len(value) == 2 \
            and isinstance(value[0], str) and isinstance(value[1], int) \
            and value[1] >= 0

class ClassValuesContextHandler(ContextHandler):
    """Context handler used for widgets that work with
    a single discrete variable"""

    def open_context(self, widget, classes):
        if isinstance(classes, Variable):
            if classes.is_discrete:
                classes = classes.values
            else:
                classes = None

        super().open_context(widget, classes)

    def new_context(self, classes):
        context = super().new_context()
        context.classes = classes
        return context

    def match(self, context, classes):
        if isinstance(classes, Variable) and classes.is_continuous:
            return (self.PERFECT_MATCH if context.classes is None
                    else self.NO_MATCH)
        else:
            # variable.values used to be a list, and so were context.classes
            # cast to tuple for compatibility with past contexts
            if context.classes is not None and tuple(context.classes) == classes:
                return self.PERFECT_MATCH
            else:
                return self.NO_MATCH


class PerfectDomainContextHandler(DomainContextHandler):
    """Context handler that matches a context only when
    the same domain is available.

    It uses a different encoding than the DomainContextHandler.
    """

    def new_context(self, domain, attributes, class_vars, metas):
        """Same as DomainContextHandler, but also store class_vars"""
        context = super().new_context(domain, attributes, metas)
        context.class_vars = class_vars
        return context

    def clone_context(self, old_context, *args):
        """Copy of context is always valid, since widgets are using
        the same domain."""
        context = self.new_context(*args)
        context.values = copy.deepcopy(old_context.values)
        return context

    def encode_domain(self, domain):
        """Encode domain into tuples (name, type)
        A tuple is returned for each of attributes, class_vars and metas.
        """

        if self.match_values == self.MATCH_VALUES_ALL:
            def _encode(attrs):
                return tuple((v.name, list(v.values) if v.is_discrete else vartype(v))
                             for v in attrs)
        else:
            def _encode(attrs):
                return tuple((v.name, vartype(v)) for v in attrs)
        return (_encode(domain.attributes),
                _encode(domain.class_vars),
                _encode(domain.metas))

    def match(self, context, domain, attributes, class_vars, metas):
        """Context only matches when domains are the same"""

        return (self.PERFECT_MATCH
                if (context.attributes == attributes and
                    context.class_vars == class_vars and
                    context.metas == metas)
                else self.NO_MATCH)

    def encode_setting(self, context, setting, value):
        """Same as is domain context handler, but handles separately stored
        class_vars."""

        if isinstance(setting, ContextSetting) and isinstance(value, str):

            def _candidate_variables():
                if not setting.exclude_attributes:
                    yield from itertools.chain(context.attributes,
                                               context.class_vars)
                if not setting.exclude_metas:
                    yield from context.metas

            for aname, atype in _candidate_variables():
                if aname == value:
                    return value, atype

            return value, -1
        else:
            return super().encode_setting(context, setting, value)


def migrate_str_to_variable(settings, names=None, none_placeholder=None):
    """
    Change variables stored as `(str, int)` to `(Variable, int)`.

    Args:
        settings (Context): context that is being migrated
        names (sequence): names of settings to be migrated. If omitted,
            all settings with values `(str, int)` are migrated.
    """
    def _fix(name):
        var, vtype = settings.values[name]
        if 0 <= vtype <= 100:
            settings.values[name] = (var, 100 + vtype)
        elif var == none_placeholder and vtype == -2:
            settings.values[name] = None

    if names is None:
        for name, setting in settings.values.items():
            if DomainContextHandler.is_encoded_var(setting):
                _fix(name)
    elif isinstance(names, str):
        _fix(names)
    else:
        for name in names:
            _fix(name)

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
user